summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2007-01-21 17:10:14 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2007-01-21 17:10:14 +0100
commita0e2a994b8bd3b35e2916b124e7c672ce4dd608c (patch)
treef0620793052ed0e71ba1d96b7977269fb95e601f
parent11c4e61b49640d5d5ac95e0b52f8139ac40b59c6 (diff)
inotail.c: Use strcmp rather than strncmp
We're compare against a constant string
-rw-r--r--inotail.c4
1 files 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);