[utmpdump.c:82]: (style) The function 'unspace' is never used
[utmpdump.c:131]: (style) The scope of the variable 't' can be reduced
[utmpdump.c:167]: (warning) scanf without field width limits can crash with huge input data
[kzak@redhat.com: - don't use scanf field width limits for integers]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
*s = '?';
}
-static void unspace(char *s, int len)
-{
- while (*s && *s != ' ' && len--)
- ++s;
-
- if (len > 0)
- *s = '\0';
-}
-
static void print_utline(struct utmp ut)
{
char *addr_string, *time_string;
static int gettok(char *line, char *dest, int size, int eatspace)
{
int bpos, epos, eaten;
- char *t;
bpos = strchr(line, '[') - line;
if (bpos < 0)
eaten = bpos + epos + 1;
if (eatspace) {
+ char *t;
if ((t = strchr(line, ' ')))
*t = 0;
}