- Timestamp:
- Sep 9, 2012 2:30:17 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/printf.c
r2591 r2646 638 638 size_t len; 639 639 640 len = strlen(str) + 2;641 if (len > sizeof copy) {640 len = strlen(str) - 1; 641 if (len > sizeof(copy) - 5) { 642 642 warnx("format %s too complex\n", str); 643 643 len = 4; 644 644 } 645 (void)memmove(copy, str, len - 3); 646 copy[len - 3] = 'j'; 647 copy[len - 2] = ch; 648 copy[len - 1] = '\0'; 645 (void)memmove(copy, str, len); 646 #ifndef _MSC_VER 647 copy[len++] = 'j'; 648 #else 649 copy[len++] = 'I'; 650 copy[len++] = '6'; 651 copy[len++] = '4'; 652 #endif 653 copy[len++] = ch; 654 copy[len] = '\0'; 649 655 return copy; 650 656 }
Note:
See TracChangeset
for help on using the changeset viewer.