diff options
-rw-r--r-- | command.c | 2 | ||||
-rw-r--r-- | db.c | 1 | ||||
-rw-r--r-- | main.c | 1 | ||||
-rw-r--r-- | user_data.c | 4 |
4 files changed, 5 insertions, 3 deletions
@@ -60,7 +60,7 @@ static bool send_name(int fd,const char *tag,const char *name){ static bool send_list(int fd,const char *tag,i64 count,const char **list){ char *buf=NULL; - i64 len=asprintf(&buf,"%s list %lld",tag,count); + i64 len=asprintf(&buf,"%s list %" PRIi64,tag,count); assert(buf); bool closed=send_raw_text(fd,buf,len); free(buf); @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include <stdlib.h> #include <string.h> #include <assert.h> @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/user_data.c b/user_data.c index 65587ad..26e573a 100644 --- a/user_data.c +++ b/user_data.c @@ -30,7 +30,7 @@ void userdata_register(i64 userid,int fd){ if(item){ for(i64 i=0;i<item->data.fds_len;i++){ if(item->data.fds[i]==fd){ - die("userdata_register(%lld, %d) while pair already existed",userid,fd); + die("userdata_register(%" PRIi64 ", %d) while pair already existed",userid,fd); } } if(item->data.fds_len==item->data.fds_cap){ @@ -58,7 +58,7 @@ void userdata_unregister(i64 userid,int fd){ if(item->data.fds[i]==fd)break; } if(i==item->data.fds_len){ - die("userdata_unregister(%lld, %d) while nonexistent",userid,fd); + die("userdata_unregister(%" PRIi64 ", %d) while nonexistent",userid,fd); } memmove(item->data.fds+i,item->data.fds+i+1,item->data.fds_len-i-1); item->data.fds_len--; |