lib: avoid format truncation
commonio.c: In function 'commonio_unlock':
commonio.c:487:49: warning: '.lock' directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
487 | snprintf (lock, sizeof lock, "%s.lock", db->filename);
| ^~~~~
commonio.c:487:17: note: 'snprintf' output between 6 and 1029 bytes into a destination of size 1024
487 | snprintf (lock, sizeof lock, "%s.lock", db->filename);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
committed by
Serge Hallyn
parent
ce3a4ac7a3
commit
d2e7edcd00
@@ -467,7 +467,7 @@ static void dec_lock_count (void)
|
||||
|
||||
int commonio_unlock (struct commonio_db *db)
|
||||
{
|
||||
char lock[1024];
|
||||
char lock[1029];
|
||||
|
||||
if (db->isopen) {
|
||||
db->readonly = true;
|
||||
|
||||
Reference in New Issue
Block a user