aboutsummaryrefslogtreecommitdiff
path: root/libbb/last_char_is.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/last_char_is.c')
-rw-r--r--libbb/last_char_is.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libbb/last_char_is.c b/libbb/last_char_is.c
index a95e57c35..4e2ee92ed 100644
--- a/libbb/last_char_is.c
+++ b/libbb/last_char_is.c
@@ -28,7 +28,10 @@
28 */ 28 */
29char * last_char_is(const char *s, int c) 29char * last_char_is(const char *s, int c)
30{ 30{
31 char *sret = (char *)s+strlen(s)-1; 31 char *sret;
32 if (!s)
33 return NULL;
34 sret = (char *)s+strlen(s)-1;
32 if (sret>=s && *sret == c) { 35 if (sret>=s && *sret == c) {
33 return sret; 36 return sret;
34 } else { 37 } else {