diff options
-rw-r--r-- | editors/patch.c | 8 | ||||
-rwxr-xr-x | scripts/checkstack.pl | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/editors/patch.c b/editors/patch.c index 5f7f7d028..f071a0854 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -55,10 +55,12 @@ static char *extract_filename(char *line, int patch_level) | |||
55 | int i; | 55 | int i; |
56 | 56 | ||
57 | /* Terminate string at end of source filename */ | 57 | /* Terminate string at end of source filename */ |
58 | temp = strchr(filename_start_ptr, '\t'); | 58 | temp = strchrnul(filename_start_ptr, '\t'); |
59 | if (temp) *temp = 0; | 59 | *temp = '\0'; |
60 | 60 | ||
61 | /* skip over (patch_level) number of leading directories */ | 61 | /* Skip over (patch_level) number of leading directories */ |
62 | if (patch_level == -1) | ||
63 | patch_level = INT_MAX; | ||
62 | for (i = 0; i < patch_level; i++) { | 64 | for (i = 0; i < patch_level; i++) { |
63 | temp = strchr(filename_start_ptr, '/'); | 65 | temp = strchr(filename_start_ptr, '/'); |
64 | if (!temp) | 66 | if (!temp) |
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 41454ceb1..6f455241a 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl | |||
@@ -39,6 +39,9 @@ my (@stack, $re, $x, $xs); | |||
39 | if ($arch eq 'arm') { | 39 | if ($arch eq 'arm') { |
40 | #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 | 40 | #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 |
41 | $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; | 41 | $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; |
42 | } elsif ($arch eq 'blackfin') { | ||
43 | # 52: 00 e8 03 00 LINK 0xc; | ||
44 | $re = qr/.*LINK (0x$x{1,5});$/o; | ||
42 | } elsif ($arch =~ /^i[3456]86$/) { | 45 | } elsif ($arch =~ /^i[3456]86$/) { |
43 | #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp | 46 | #c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp |
44 | $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/o; | 47 | $re = qr/^.*[as][du][db] \$(0x$x{1,8}),\%esp$/o; |