Hi,
how do I incorporate a value inside a string ?
Code:
strncpy(buffer, input.usernbr, USERNBR_LEN);
buffer[USERNBR_LEN] = '\0';
if(!isdigit(buffer) || is_all_spaces(input.usernbr, USERNBR_LEN))
{
strcpy(error_message, "EQ USERNBR INVALID - buffer\n");
write_log_file(curtime,
/* OUTPUT */
---------------------------------------------------------------
Progname: eq_recon_mtn_cnx_format_eq
Started: 2003/10/15 09:57:15 GMT
File: R3AP200310_EQRSNACNXX_00001_20031014125499.SND
---------------------------------------------------------------
---> Number of Records Read: 1
---> Number of Records Written: 0
EQ USERNBR INVALID - buffer
---------------------------------------------------------------
Ended: 2003/10/15 09:57:15 GMT
---------------------------------------------------------------
what I should be getting is
EQ USERNBR INVALID - 85756999
strcpy does not seem to accept format specifiers, so presumably I have to pass the value though anther function first ?
tia,