From 4aa1848c27da1c45b6204956ae28e9e83bc840c5 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 20 Jan 2017 14:24:40 +0100 Subject: strtol -> strtoll --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 8806683..5854542 100644 --- a/main.c +++ b/main.c @@ -251,7 +251,7 @@ i64 handle_message(Connection *conn){ } else if(strcmp(cmdname,"room_create")==0){ // room_create gameid roomid public capacity if(nargs!=4)return tcp_send_line(conn->sock,"error room_create Invalid command format"); char *endp; - i64 capacity=strtol(args[3],&endp,10); + i64 capacity=strtoll(args[3],&endp,10); if(strlen(args[0])==0||strlen(args[1])==0||strlen(args[2])!=1|| strchr("10",args[2][0])==NULL||args[3][0]=='\0'||*endp!='\0'||capacity<=0){ return tcp_send_line(conn->sock,"error room_create Invalid command format"); @@ -354,11 +354,11 @@ i64 handle_message(Connection *conn){ if(LIST_FIND(&room->members,conn)==-1)return tcp_send_line(conn->sock,"error room_message Not in room"); char *endp; - i64 targetid=strtol(args[2],&endp,10); + i64 targetid=strtoll(args[2],&endp,10); if(args[2][0]=='\0'||*endp!='\0'||targetid<=0){ return tcp_send_line(conn->sock,"error room_message Invalid command format"); } - i64 msglength=strtol(args[3],&endp,10); + i64 msglength=strtoll(args[3],&endp,10); if(args[3][0]=='\0'||*endp!='\0'||msglength<0){ return tcp_send_line(conn->sock,"error room_message Invalid command format"); } -- cgit v1.2.3