small optimization
authorDenis Vlasenko <vda.linux@googlemail.com>
Fri, 24 Nov 2006 22:42:44 +0000 (22:42 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Fri, 24 Nov 2006 22:42:44 +0000 (22:42 -0000)
libbb/last_char_is.c

index 80a6fe2e4e7be821341e16943f39d6d077a53c10..3616d5916df60f60a91634e35d1ad5e16b614cdc 100644 (file)
  */
 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;
 }