Changeset 2561
- Timestamp:
- 07/11/07 16:34:00 (1 year ago)
- Files:
-
- trunk/src/h2ext.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/h2ext.c
r2558 r2561 46 46 #define MAX_PEEK_SIZE 4096 47 47 #define MIN(a,b) (((a) > (b)) ? (b) : (a)) 48 #define STRINGIFY_(x) #x 49 #define STRINGIFY(x) STRINGIFY_(x) 48 50 49 51 struct file_format { … … 274 276 i->next = NULL; 275 277 276 #define get_field() for (ptr++; *ptr == '\t' && *ptr != '\0'; ptr++); \ 277 for (field = ptr; *ptr != '\t' && *ptr != '\0'; ptr++); \ 278 *ptr = '\0'; 278 #define get_field() if (*(ptr+1) == '\0') goto new_line_and_free; \ 279 for (ptr++; *ptr == '\t' && *ptr != '\0'; ptr++); \ 280 for (field = ptr; *ptr != '\t' && *ptr != '\0'; ptr++); \ 281 *ptr = '\0'; 279 282 field = ptr = buf; 280 283 while (*ptr != '\t' && *ptr != '\0') … … 362 365 i->peek_inside = (int)strtol(field, NULL, 0); 363 366 367 /* sanity check the entry */ 368 if (i->offset < 0) { 369 WRITE_MSG(2, ENSC_WRAPPERS_PREFIX); 370 WRITE_STR(2, file); 371 WRITE_MSG(2, ":"); 372 WRITE_INT(2, line_no); 373 WRITE_MSG(2, " has an invalid offset: "); 374 WRITE_INT(2, i->offset); 375 WRITE_MSG(2, "\n"); 376 goto new_line_and_free; 377 } 378 else if ((i->offset + i->len) > MAX_PEEK_SIZE) { 379 WRITE_MSG(2, ENSC_WRAPPERS_PREFIX); 380 WRITE_STR(2, file); 381 WRITE_MSG(2, ":"); 382 WRITE_INT(2, line_no); 383 WRITE_MSG(2, " exceeds maximum offset (" STRINGIFY(MAX_PEEK_SIZE) ")\n"); 384 goto new_line_and_free; 385 } 364 386 #undef get_field 365 387 goto new_line;
