diff options
author | rowanbeentje <rowan@beent.je> | 2008-12-15 01:43:51 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2008-12-15 01:43:51 +0000 |
commit | 3715748cb2e339b8a4afe9c7c9e5ae89560812d8 (patch) | |
tree | 7dd1d1593a2c9eb25fea5e7618650916d1109a22 | |
parent | aa75714d3e0720c9bec5d673444a72f37addc974 (diff) | |
download | sequelpro-3715748cb2e339b8a4afe9c7c9e5ae89560812d8.tar.gz sequelpro-3715748cb2e339b8a4afe9c7c9e5ae89560812d8.tar.bz2 sequelpro-3715748cb2e339b8a4afe9c7c9e5ae89560812d8.zip |
Fixed a range assertion error in SQL dumps when exporting small strings, caused by r274
-rw-r--r-- | Source/TableDump.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 48ff5b04..ab96baf3 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -850,10 +850,12 @@ // Until we have access to field types, test whether this cell contains a // number via use of an NSScanner and a check of the first couple of - // characters. If it is a number, add the number directly. + // characters (0[^.] is not a number). If it is a number, add the number directly. sqlNumericTester = [NSScanner scannerWithString:cellValue]; if ([sqlNumericTester scanFloat:nil] && [sqlNumericTester isAtEnd] && - ([cellValue characterAtIndex:0] != '0' || [cellValue characterAtIndex:1] == '.')) { + ([cellValue characterAtIndex:0] != '0' + || [cellValue length] == 1 + || ([cellValue length] > 1 && [cellValue characterAtIndex:1] == '.'))) { [sqlString appendString:cellValue]; // Otherwise add a quoted string with special characters escaped |