aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFieldEditorController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPFieldEditorController.m')
-rw-r--r--Source/SPFieldEditorController.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m
index bf48ec80..7bdd2eb9 100644
--- a/Source/SPFieldEditorController.m
+++ b/Source/SPFieldEditorController.m
@@ -225,10 +225,10 @@
// Init according bit check boxes
NSUInteger i = 0;
NSUInteger maxBit = (NSUInteger)((maxTextLength > 64) ? 64 : maxTextLength);
- if([bitSheetNULLButton state] == NSOffState)
+ if([bitSheetNULLButton state] == NSOffState && maxBit <= [(NSString*)sheetEditData length])
for( i = 0; i<maxBit; i++ )
[[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]]
- setState:([sheetEditData characterAtIndex:(maxBit-i-1)] == '1') ? NSOnState : NSOffState];
+ setState:([(NSString*)sheetEditData characterAtIndex:(maxBit-i-1)] == '1') ? NSOnState : NSOffState];
for( i = maxBit; i<64; i++ )
[[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setEnabled:NO];