From: Roy Marples Date: Wed, 5 Feb 2014 16:44:24 +0000 (+0000) Subject: Replace get_line with sscanf X-Git-Tag: v6.3.0~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37c9ec362cadfb210e3545e480f0b792627b24f7;p=thirdparty%2Fdhcpcd.git Replace get_line with sscanf --- diff --git a/auth.c b/auth.c index 0cfd95af..f7d546e1 100644 --- a/auth.c +++ b/auth.c @@ -374,7 +374,6 @@ static uint64_t get_next_rdm_monotonic_counter(void) { FILE *fp; - char *line, *ep; uint64_t rdm; int flocked; @@ -389,13 +388,8 @@ get_next_rdm_monotonic_counter(void) rdm = 0; } else { flocked = flock(fileno(fp), LOCK_EX); - line = get_line(fp); - if (line == NULL) + if (fscanf(fp, "0x%016" PRIu64, &rdm) != 1) rdm = 0; /* truncated? report error? */ - else { - rdm = strtoull(line, &ep, 0); - free(line); - } } rdm++;