mirror of
https://passt.top/passt
synced 2025-06-07 00:15:34 +02:00
treewide: Make a bunch of pointer variables pointers to const
Sufficiently recent cppcheck (I'm using 2.13.0) seems to have added another warning for pointer variables which could be pointer to const but aren't. Use this to make a bunch of variables const pointers where they previously weren't for no particular reason. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
f60c85194b
commit
a179ca6707
11 changed files with 41 additions and 34 deletions
6
log.c
6
log.c
|
@ -222,7 +222,8 @@ void logfile_init(const char *name, const char *path, size_t size)
|
|||
*/
|
||||
static void logfile_rotate_fallocate(int fd, const struct timespec *ts)
|
||||
{
|
||||
char buf[BUFSIZ], *nl;
|
||||
char buf[BUFSIZ];
|
||||
const char *nl;
|
||||
int n;
|
||||
|
||||
if (lseek(fd, 0, SEEK_SET) == -1)
|
||||
|
@ -260,7 +261,8 @@ static void logfile_rotate_fallocate(int fd, const struct timespec *ts)
|
|||
static void logfile_rotate_move(int fd, const struct timespec *ts)
|
||||
{
|
||||
int header_len, write_offset, end, discard, n;
|
||||
char buf[BUFSIZ], *nl;
|
||||
char buf[BUFSIZ];
|
||||
const char *nl;
|
||||
|
||||
header_len = snprintf(buf, BUFSIZ,
|
||||
"%s - log truncated at %lli.%04lli\n", log_header,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue