Skip to content

Commit

Permalink
utils: fix a compiler warning
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Apr 29, 2024
1 parent 6df8cef commit a946f04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libcrun/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ get_timestamp (timestamp_t *timestamp, const char *suffix)
gettimeofday (&tv, NULL);
gmtime_r (&tv.tv_sec, &now);
strftime ((char *) timestamp, 64, "%Y-%m-%dT%H:%M:%S", &now);
sprintf (((char *) timestamp) + 19, ".%06ldZ%.8s", tv.tv_usec, suffix);
sprintf (((char *) timestamp) + 19, ".%06lldZ%.8s", (long long int) tv.tv_usec, suffix);
}

static void *
Expand Down
2 changes: 1 addition & 1 deletion src/libcrun/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ get_current_timestamp (char *out, size_t len)
gmtime_r (&tv.tv_sec, &now);
strftime (timestamp, sizeof (timestamp), "%Y-%m-%dT%H:%M:%S", &now);

snprintf (out, len, "%s.%06ldZ", timestamp, tv.tv_usec);
snprintf (out, len, "%s.%06lldZ", timestamp, (long long int) tv.tv_usec);
out[len - 1] = '\0';
}

Expand Down

0 comments on commit a946f04

Please sign in to comment.