diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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"); } |