diff options
| author | 2007-09-11 16:30:59 +0000 | |
|---|---|---|
| committer | 2007-09-11 16:30:59 +0000 | |
| commit | 673a9bc7975637e3f6be7fecd5af272ae0eca252 (patch) | |
| tree | 013158fdf66c24dd9b482d22fc390c18228da9cd /usr.sbin/httpd/src/support/logresolve.c | |
| parent | More 64 bits counters fixes. (diff) | |
| download | wireguard-openbsd-673a9bc7975637e3f6be7fecd5af272ae0eca252.tar.xz wireguard-openbsd-673a9bc7975637e3f6be7fecd5af272ae0eca252.zip | |
use strcspn to properly overwrite '\n' in fgets returned buffer
ok pyr@, ray@, millert@, moritz@, chl@
Diffstat (limited to 'usr.sbin/httpd/src/support/logresolve.c')
| -rw-r--r-- | usr.sbin/httpd/src/support/logresolve.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/usr.sbin/httpd/src/support/logresolve.c b/usr.sbin/httpd/src/support/logresolve.c index 9223043494d..df940d75d65 100644 --- a/usr.sbin/httpd/src/support/logresolve.c +++ b/usr.sbin/httpd/src/support/logresolve.c @@ -244,13 +244,9 @@ static void stats (FILE *output) static int getline (char *s, int n) { - char *cp; - if (!fgets(s, n, stdin)) return (0); - cp = strchr(s, '\n'); - if (cp) - *cp = '\0'; + s[strcspn(s, "\n")] = '\0'; return (1); } |
