diff options
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | request.h | 6 | ||||
-rw-r--r-- | ticket.c | 2 | ||||
-rw-r--r-- | user.c | 2 |
4 files changed, 7 insertions, 7 deletions
@@ -35,7 +35,7 @@ int main(void) rtclient_user_showname(&user, name); if (user) { - printf("id: %d\nname: %s\npassword: %s\nemailaddress: %s\nrealname: %s\nnickname: %s\norganization: %s\naddress1: %s\naddress2: %s\ncity: %s\nstate: %s\nzip: %s\ncountry: %s\nhomephone: %s\nworkphone: %s\nmobilephone: %s\npagerphone: %s\ncontactinfo: %s\ncomments: %s\nsignature: %s\ngecos: %s\nlang: %d\ntimezone: %d\nprivileged: %d\ndisabled: %d\n" + printf("id: %u\nname: %s\npassword: %s\nemailaddress: %s\nrealname: %s\nnickname: %s\norganization: %s\naddress1: %s\naddress2: %s\ncity: %s\nstate: %s\nzip: %s\ncountry: %s\nhomephone: %s\nworkphone: %s\nmobilephone: %s\npagerphone: %s\ncontactinfo: %s\ncomments: %s\nsignature: %s\ngecos: %s\nlang: %u\ntimezone: %u\nprivileged: %u\ndisabled: %u\n" , user->id , user->name , user->password @@ -71,7 +71,7 @@ int main(void) if (list) { for (size_t i = 0; i < list->length; i++) { struct rtclient_ticket *ticket = list->tickets[i]; - printf("%d: %s\n", ticket->id, ticket->subject); + printf("%u: %s\n", ticket->id, ticket->subject); } rtclient_ticket_freelist(list); } @@ -29,7 +29,7 @@ inline void request(size_t (*writefunction)(void *, size_t, size_t, void *) sval = va_arg(ap, char *); length += strlen(sval) - 2; break; - case 'd': + case 'u': ival = va_arg(ap, unsigned int); do { length++; @@ -54,9 +54,9 @@ inline void request(size_t (*writefunction)(void *, size_t, size_t, void *) sval = va_arg(ap, char *); strcat(url, sval); break; - case 'd': + case 'u': ival = va_arg(ap, unsigned int); - sprintf(url, "%s%d", url, ival); + sprintf(url, "%s%u", url, ival); break; default: break; @@ -107,7 +107,7 @@ void rtclient_ticket_search(rtclient_ticketlist **listptr, const char *query) void rtclient_ticket_history(unsigned int id) { - request(NULL, NULL, NULL, "%s%d%s", "REST/1.0/ticket/", id + request(NULL, NULL, NULL, "%s%u%s", "REST/1.0/ticket/", id , "/history?format=l"); } @@ -214,7 +214,7 @@ static inline void user_init(rtclient_user **userptr) void rtclient_user_showid(rtclient_user **userptr, unsigned int id) { user_init(userptr); - request(show_callback, (void *)userptr, NULL, "%s%d", "REST/1.0/user/" + request(show_callback, (void *)userptr, NULL, "%s%u", "REST/1.0/user/" , id); } |