diff --git a/ChangeLog b/ChangeLog index 7e0d3a50932490e8105629fe3162d4c716802d79..4f65f083e4c189052d33272c477efb0706d4d867 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ CVS code - +- chars.c: + nstrncasecmp() + - When returning, use the "?" operator instead of an if/else + clause. (DLR) - files.c: input_tab() - Since the field precision operator used in the sprintf() uses diff --git a/src/chars.c b/src/chars.c index 1f651264e96c421088be5e1e7e7403368e30ae60..2496a0eb5276c0fd7f45b049f912490958fd3e66 100644 --- a/src/chars.c +++ b/src/chars.c @@ -514,10 +514,7 @@ int nstrncasecmp(const char *s1, const char *s2, size_t n) break; } - if (n > 0) - return tolower(*s1) - tolower(*s2); - else - return 0; + return (n > 0) ? tolower(*s1) - tolower(*s2) : 0; } #endif @@ -1026,8 +1023,7 @@ bool is_valid_mbstring(const char *s) return #ifdef ENABLE_UTF8 - use_utf8 ? - (mbstowcs(NULL, s, 0) != (size_t)-1) : + use_utf8 ? (mbstowcs(NULL, s, 0) != (size_t)-1) : #endif TRUE; }