Skip to content

Commit

Permalink
Log the line number as well in strlcatf
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalle19 committed Jun 27, 2024
1 parent c10f8e9 commit 966e2fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ void _strncpy(char *a, char *b, int len);

#define strlcatf(buf, size, ptr, fmt...) \
do { \
int __r = snprintf((buf) + ptr, (size)-ptr, fmt); \
int __r = snprintf((buf) + ptr, (size) - ptr, fmt); \
ptr += __r; \
if (ptr >= (size)) { \
LOG("%s buffer size too small (%d)", __FUNCTION__, size); \
ptr = (size)-1; \
LOG("%s:%d buffer size too small (%d)", __FUNCTION__, __LINE__, \
size); \
ptr = (size) - 1; \
} \
} while (0)

Expand Down

0 comments on commit 966e2fc

Please sign in to comment.