Switch to strtol(). Also, NEVER declare after statements

This commit is contained in:
dcp1990 2005-06-18 20:40:15 +00:00
parent 7fa7571f61
commit e209c4645f
2 changed files with 5 additions and 4 deletions

View File

@ -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 <stdlib.h>
#include <limits.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
@ -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;
}

View File

@ -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");