diff options
author | Denis Vlasenko | 2006-11-24 22:42:44 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-11-24 22:42:44 +0000 |
commit | 809a6e310443d0b5010c8b293cab0160608c1b02 (patch) | |
tree | 1ebb9f979ab2e72b6679eb0326ccd54dc001a201 /libbb/last_char_is.c | |
parent | 3feb2fc535db445951314f57a8f7ecc460b456d9 (diff) | |
download | busybox-809a6e310443d0b5010c8b293cab0160608c1b02.zip busybox-809a6e310443d0b5010c8b293cab0160608c1b02.tar.gz |
small optimization
Diffstat (limited to 'libbb/last_char_is.c')
-rw-r--r-- | libbb/last_char_is.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libbb/last_char_is.c b/libbb/last_char_is.c index 80a6fe2..3616d59 100644 --- a/libbb/last_char_is.c +++ b/libbb/last_char_is.c @@ -15,11 +15,10 @@ */ char* last_char_is(const char *s, int c) { - char *sret; if (s) { - sret = strrchr(s, c); - if (sret && !sret[1]) - return sret; + s = strrchr(s, c); + if (s && !s[1]) + return (char*)s; } return NULL; } |