summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-30 10:51:34 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-30 10:51:34 +0800
commit7180c051d619f0605f2c45929eb516d28bcb709f (patch)
tree243219ac46264f10720dfa6fc22f2304f321f353
parent739bcbbd83115cb8cf3f5b60fd7e73056a0c7293 (diff)
The decimal notations used so far are unsigned integers
-rw-r--r--main.c4
-rw-r--r--request.h6
-rw-r--r--ticket.c2
-rw-r--r--user.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/main.c b/main.c
index e18939f..c0183fd 100644
--- a/main.c
+++ b/main.c
@@ -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);
}
diff --git a/request.h b/request.h
index b8edc81..136f202 100644
--- a/request.h
+++ b/request.h
@@ -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;
diff --git a/ticket.c b/ticket.c
index 2e26b81..9ec8bc7 100644
--- a/ticket.c
+++ b/ticket.c
@@ -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");
}
diff --git a/user.c b/user.c
index adba576..9c7f94b 100644
--- a/user.c
+++ b/user.c
@@ -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);
}