From 03583f8d646f4cc4d5f91b7ed763c147a00e2f44 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 31 Mar 2011 17:59:16 +0200 Subject: maint: prohibit direct use of strncmp: prefer STREQ_LEN, STRNCMP_LIT * cfg.mk (sc_prohibit_strncmp): New rule, mostly from libvirt. * src/system.h (STREQ_LEN, STRPREFIX, STRNCMP_LIT): Define. * src/df.c (get_dev, get_point): Convert. * src/extent-scan.c (extent_need_sync): Likewise. * src/ls.c (is_colored, decode_switches): Likewise. (parse_ls_color, (print_color_indicator): Likewise. * src/md5sum.c (split_3): Likewise. * src/split.c (main, emit_ancillary_info): Likewise. * src/tr.c (look_up_char_class): Likewise. * src/uname.c (main): Likewise. * src/who.c (scan_entries): Likewise. --- src/split.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/split.c') diff --git a/src/split.c b/src/split.c index 364576aa8..3a630a001 100644 --- a/src/split.c +++ b/src/split.c @@ -895,12 +895,12 @@ main (int argc, char **argv) /* skip any whitespace */ while (isspace (to_uchar (*optarg))) optarg++; - if (strncmp (optarg, "r/", 2) == 0) + if (STRNCMP_LIT (optarg, "r/") == 0) { split_type = type_rr; optarg += 2; } - else if (strncmp (optarg, "l/", 2) == 0) + else if (STRNCMP_LIT (optarg, "l/") == 0) { split_type = type_chunk_lines; optarg += 2; -- cgit v1.2.3-54-g00ecf