From e209c4645f331eca1d976d9e5b17a98a3d501826 Mon Sep 17 00:00:00 2001 From: dcp1990 Date: Sat, 18 Jun 2005 20:40:15 +0000 Subject: [PATCH] Switch to strtol(). Also, NEVER declare after statements --- phoned/cid.c | 7 ++++--- phoned/socket.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phoned/cid.c b/phoned/cid.c index af5099b..22ee672 100644 --- a/phoned/cid.c +++ b/phoned/cid.c @@ -27,9 +27,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -/* $Amigan: phoned/phoned/cid.c,v 1.3 2005/06/13 01:13:30 dcp1990 Exp $ */ +/* $Amigan: phoned/phoned/cid.c,v 1.4 2005/06/18 20:40:15 dcp1990 Exp $ */ /* system includes */ #include +#include #include #include #include @@ -159,8 +160,8 @@ cid_t* parse_cid(char* cidstring) c->number = strdup(phone); sscanf(cidtime, "%d:%d", (int*)&c->hour, (int*)&c->minute); date[2] = 0x0; - c->month = atoi(date); - c->day = atoi(date + 3); + c->month = strtol(date, NULL, 10); + c->day = strtol(date + 3, NULL, 10); date[2] = '/'; return c; } diff --git a/phoned/socket.c b/phoned/socket.c index d02ea41..04c9e44 100644 --- a/phoned/socket.c +++ b/phoned/socket.c @@ -71,8 +71,8 @@ void *network(b) pthread_t thr; char cbuf[1]; void* is; - cbuf[0] = '\0'; cbuf[1] = '\0'; struct sockaddr_un it; + cbuf[0] = '\0'; cbuf[1] = '\0'; is = b; if((s = socket(AF_LOCAL, SOCK_STREAM, 0)) == -1) { perror("socket");