minor simplification of get_string_width_special()
authorPhil Sutter <phil@nwl.cc>
Sun, 20 Sep 2009 01:17:55 +0000 (03:17 +0200)
committerPhil Sutter <phil@nwl.cc>
Sun, 20 Sep 2009 11:16:20 +0000 (13:16 +0200)
src/conky.c

index 46ab31a..216afe6 100644 (file)
@@ -3330,13 +3330,11 @@ static int get_string_width_special(char *s, int special_index)
        int width = 0;
        long i;
 
-       if ((output_methods & TO_X) == 0) {
-               return (s) ? strlen(s) : 0;
-       }
-
-       if (!s) {
+       if (!s)
                return 0;
-       }
+
+       if ((output_methods & TO_X) == 0)
+               return strlen(s);
 
        p = strndup(s, text_buffer_size);
        final = p;