newsyslog.c (ec8a394d9c676b3c4fd2cd721cf554e073736fc1) newsyslog.c (1f78bbb5c415efefa782c1be7f9a2e4a5008903b)
1/*-
2 * ------+---------+---------+-------- + --------+---------+---------+---------*
3 * This file includes significant modifications done by:
4 * Copyright (c) 2003, 2004 - Garance Alistair Drosehn <gad@FreeBSD.org>.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 63 unchanged lines hidden (view full) ---

72#include <glob.h>
73#include <grp.h>
74#include <paths.h>
75#include <pwd.h>
76#include <signal.h>
77#include <stdbool.h>
78#include <stdio.h>
79#include <libgen.h>
1/*-
2 * ------+---------+---------+-------- + --------+---------+---------+---------*
3 * This file includes significant modifications done by:
4 * Copyright (c) 2003, 2004 - Garance Alistair Drosehn <gad@FreeBSD.org>.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 63 unchanged lines hidden (view full) ---

72#include <glob.h>
73#include <grp.h>
74#include <paths.h>
75#include <pwd.h>
76#include <signal.h>
77#include <stdbool.h>
78#include <stdio.h>
79#include <libgen.h>
80#include <libutil.h>
80#include <stdlib.h>
81#include <string.h>
82#include <syslog.h>
83#include <time.h>
84#include <unistd.h>
85
86#include "pathnames.h"
87#include "extern.h"

--- 1242 unchanged lines hidden (view full) ---

1330 errline);
1331
1332 q = parse = missing_field(sob(parse + 1), errline);
1333 parse = son(parse);
1334 if (!*parse)
1335 badline("malformed line (missing fields):\n%s",
1336 errline);
1337 *parse = '\0';
81#include <stdlib.h>
82#include <string.h>
83#include <syslog.h>
84#include <time.h>
85#include <unistd.h>
86
87#include "pathnames.h"
88#include "extern.h"

--- 1242 unchanged lines hidden (view full) ---

1331 errline);
1332
1333 q = parse = missing_field(sob(parse + 1), errline);
1334 parse = son(parse);
1335 if (!*parse)
1336 badline("malformed line (missing fields):\n%s",
1337 errline);
1338 *parse = '\0';
1338 if (isdigitch(*q))
1339 working->trsize = atoi(q);
1340 else if (strcmp(q, "*") == 0)
1339 if (isdigitch(*q)) {
1340 char last_digit = q[strlen(q) - 1];
1341 if (isdigitch(last_digit))
1342 working->trsize = atoi(q);
1343 else {
1344 uint64_t trsize = 0;
1345 if (expand_number(q, &trsize) == 0)
1346 working->trsize = trsize / 1024;
1347 else {
1348 working->trsize = -1;
1349 warnx("Invalid value of '%s' for 'size' in line:\n%s",
1350 q, errline);
1351 }
1352 }
1353 } else if (strcmp(q, "*") == 0)
1341 working->trsize = -1;
1342 else {
1343 warnx("Invalid value of '%s' for 'size' in line:\n%s",
1344 q, errline);
1345 working->trsize = -1;
1346 }
1347
1348 working->flags = 0;

--- 1580 unchanged lines hidden ---
1354 working->trsize = -1;
1355 else {
1356 warnx("Invalid value of '%s' for 'size' in line:\n%s",
1357 q, errline);
1358 working->trsize = -1;
1359 }
1360
1361 working->flags = 0;

--- 1580 unchanged lines hidden ---