From a0e2a994b8bd3b35e2916b124e7c672ce4dd608c Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 21 Jan 2007 17:10:14 +0100 Subject: inotail.c: Use strcmp rather than strncmp We're compare against a constant string --- inotail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inotail.c b/inotail.c index 48cd530..6fed0cf 100644 --- a/inotail.c +++ b/inotail.c @@ -95,7 +95,7 @@ static inline void ignore_file(struct file_struct *f) static inline char *pretty_name(char *filename) { - return (strncmp(filename, "-", 1) == 0) ? "standard input" : filename; + return (strcmp(filename, "-") == 0) ? "standard input" : filename; } static void write_header(char *filename) @@ -222,7 +222,7 @@ static int tail_file(struct file_struct *f, unsigned int n_units, char mode, cha char buf[BUFFER_SIZE]; struct stat finfo; - if (strncmp(f->name, "-", 1) == 0) + if (strcmp(f->name, "-") == 0) f->fd = STDIN_FILENO; else { f->fd = open(f->name, O_RDONLY); -- cgit v1.2.3-54-g00ecf