Fix warnings for printf formats

r1975 | dcl | 2007-05-22 08:29:38 +1000 (Tue, 22 May 2007) | 2 lines
This commit is contained in:
Douglas Clowes
2007-05-22 08:29:38 +10:00
parent 6d449014fc
commit 377ce04879
2 changed files with 7 additions and 6 deletions

View File

@@ -43,6 +43,7 @@
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <unistd.h>
@@ -371,11 +372,11 @@
info_ptr->msg_id++; /* Set up an incrementing message id */
if (info_ptr->msg_id > 9999) info_ptr->msg_id = 1;
sprintf (info_ptr->to_host.msg_id, "%04.4d", info_ptr->msg_id);
sprintf (info_ptr->to_host.msg_id, "%4.4d", info_ptr->msg_id);
memcpy (info_ptr->to_host.c_pcol_lvl, RS__PROTOCOL_ID_V01B,
sizeof (info_ptr->to_host.c_pcol_lvl));
sprintf (info_ptr->to_host.serial_port, "%04.4d", info_ptr->chan);
sprintf (info_ptr->to_host.serial_port, "%4.4d", info_ptr->chan);
sprintf (info_ptr->to_host.tmo, "%04d", info_ptr->tmo);
strncpy(info_ptr->sAsync.eot,info_ptr->pTerms,4);
@@ -407,20 +408,20 @@
{
c_len = strlen (txt_ptr);
}
sprintf (text, "%04.4d", c_len);
sprintf (text, "%4.4d", c_len);
memcpy (cmnd_lst_ptr, text, 4);
cmnd_lst_ptr = cmnd_lst_ptr + c_len + 4;
ncmnds++;
bytes_left = bytes_left - size;
}
sprintf (text, "%04.4d", ncmnds);
sprintf (text, "%4.4d", ncmnds);
memcpy (info_ptr->to_host.n_cmnds,
text, sizeof (info_ptr->to_host.n_cmnds));
size = cmnd_lst_ptr - info_ptr->to_host.msg_id;
size = (size + 3) & (~3); /* Round up to multiple of 4 */
sprintf (text, "%04.4d", size);
sprintf (text, "%4.4d", size);
memcpy (info_ptr->to_host.msg_size, text, 4);
status = send (info_ptr->skt, (char *) &info_ptr->to_host, size+4, 0);