- 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__); \
/* 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);