projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Apply vodz' last_patch52
[oweals/busybox.git]
/
libbb
/
last_char_is.c
diff --git
a/libbb/last_char_is.c
b/libbb/last_char_is.c
index a95e57c3564e6bcf8cf63c16c8e7709562b57deb..4e2ee92ed9a71a2231a4bdafeaef1062e972ea98 100644
(file)
--- a/
libbb/last_char_is.c
+++ b/
libbb/last_char_is.c
@@
-28,7
+28,10
@@
*/
char * last_char_is(const char *s, int c)
{
- char *sret = (char *)s+strlen(s)-1;
+ char *sret;
+ if (!s)
+ return NULL;
+ sret = (char *)s+strlen(s)-1;
if (sret>=s && *sret == c) {
return sret;
} else {