diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-01-20 14:24:40 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-01-20 14:24:40 +0100 |
commit | 4aa1848c27da1c45b6204956ae28e9e83bc840c5 (patch) | |
tree | 7caae775baee6df14c39a6411ba430a0315cc5bc | |
parent | 47d78e9ce3330d6c00d5d0f3c9021e838944ae60 (diff) |
strtol -> strtoll
-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"); } |