- strncpy((d), (s), sizeof(d)); \
- (d)[sizeof(d) - 1] = 0; \
+ strncpy((d), (s), sizeof(d) - 1); \
+ (d)[sizeof(d) - 1] = '\0'; \
} while (0)
#define SSTRCATF(d, ...) \
do { \
char _b[sizeof(d)]; \
snprintf(_b, sizeof(_b), __VA_ARGS__); \
} while (0)
#define SSTRCATF(d, ...) \
do { \
char _b[sizeof(d)]; \
snprintf(_b, sizeof(_b), __VA_ARGS__); \
#if !HAVE_STRERROR_R
snprintf(buf, buflen, "Error #%i; strerror_r is not available.", errnum);
#if !HAVE_STRERROR_R
snprintf(buf, buflen, "Error #%i; strerror_r is not available.", errnum);
if ((temp != NULL) && (temp != buf) && (temp[0] != 0))
strncpy(buf, temp, buflen);
else
if ((temp != NULL) && (temp != buf) && (temp[0] != 0))
strncpy(buf, temp, buflen);
else
- snprintf(buf, buflen, "Error #%i; "
- "Additionally, strerror_r failed.",
+ snprintf(buf, buflen,
+ "Error #%i; "
+ "Additionally, strerror_r failed.",
/* Now copy the message. */
strncpy(res.message, ptr, sizeof(res.message));
/* Now copy the message. */
strncpy(res.message, ptr, sizeof(res.message));
snprintf(command, sizeof(command), "GETVAL %s",
lcc_strescape(ident_esc, ident_str, sizeof(ident_esc)));
snprintf(command, sizeof(command), "GETVAL %s",
lcc_strescape(ident_esc, ident_str, sizeof(ident_esc)));
/* Send talk to the daemon.. */
status = lcc_sendreceive(c, command, &res);
/* Send talk to the daemon.. */
status = lcc_sendreceive(c, command, &res);