Replace some size displayed with '%lu' as unsigned long
with proper '%zu' as size_t.
This commit is contained in:
1 parent
b01459d1ef
commit
603fb9db62
2 files changed
+3
-3
No files matched your search
@@ -2025,8 +2025,8 @@ m_core_hash (const void *str, size_t length)
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define M_MEMORY_FULL(size) do { \
|
#define M_MEMORY_FULL(size) do { \
|
||||||
fprintf(stderr, "ERROR(M*LIB): Can not allocate memory in function %s of file %s:%d (%lu bytes).\n", \
|
fprintf(stderr, "ERROR(M*LIB): Can not allocate memory in function %s of file %s:%d (%zu bytes).\n", \
|
||||||
__func__, __FILE__, __LINE__, (unsigned long) size); \
|
__func__, __FILE__, __LINE__, (size_t) size); \
|
||||||
abort(); \
|
abort(); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -706,7 +706,7 @@ string_fget_word (string_t v, const char separator[], FILE *f)
|
|||||||
The user shall give a constant string as the separator argument,
|
The user shall give a constant string as the separator argument,
|
||||||
as a control over this argument may give an attacker
|
as a control over this argument may give an attacker
|
||||||
an opportunity for stack overflow */
|
an opportunity for stack overflow */
|
||||||
while (snprintf(buffer, sizeof buffer -1, " %%%lu[^%s]%%c", (unsigned long) v->alloc-1-v->size, separator) > 0
|
while (snprintf(buffer, sizeof buffer -1, " %%%zu[^%s]%%c", (size_t) v->alloc-1-v->size, separator) > 0
|
||||||
&& fscanf(f, buffer, &v->ptr[v->size], &c) == 2) {
|
&& fscanf(f, buffer, &v->ptr[v->size], &c) == 2) {
|
||||||
retcode = true;
|
retcode = true;
|
||||||
v->size += strlen(&v->ptr[v->size]);
|
v->size += strlen(&v->ptr[v->size]);
|
||||||
|
|||||||
Reference in new issue
Block a user