aboutgitcodebugslistschat
path: root/log.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-01-15 17:39:43 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-01-16 21:49:27 +0100
commita179ca6707b29cfc01371fb5636b2f49d263ab83 (patch)
treea783d015ca015059be6ce1b54e91565ef221c498 /log.c
parentf60c85194b87c6cc182b9868c9e6a6b8ac1af48f (diff)
downloadpasst-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.gz
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.bz2
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.lz
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.xz
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.tar.zst
passt-a179ca6707b29cfc01371fb5636b2f49d263ab83.zip
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>
Diffstat (limited to 'log.c')
-rw-r--r--log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/log.c b/log.c
index b206f72..f71d0e2 100644
--- a/log.c
+++ b/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,