diff --git a/cart.c b/cart.c index 8cfd9a1..ad91f93 100644 --- a/cart.c +++ b/cart.c @@ -8,7 +8,7 @@ Cart* create_cart(char* name) { char path[64] = {0}; char file[64] = {0}; Cart* cart; - char* cart_data; + Blob* cart_data; scat(path, "carts/"); scat(path, name); @@ -54,7 +54,7 @@ int get_chunk(UserInfo* table, char* uname, char* chunk) { char type[8] = {0}; char chunk_id[64] = {0}; char* c = chunk; - char* data; + Blob* data; if (u == nil || u->cart == nil) return 0; diff --git a/xrxs.c b/xrxs.c index 5c5d237..d55adf9 100644 --- a/xrxs.c +++ b/xrxs.c @@ -457,12 +457,10 @@ void read_random(Req* r) { respond(r, nil); } -/* Gotta fix this by making it simpler! */ - void read_grandom(Req* r) { char buf[8] = {0}; int i; - int reset = 0; + int reset = 1; int random; UserInfo* u = find_user(users_table, r->fid->uid); UserInfo** usrs = malloc(64 * sizeof(UserInfo*)); @@ -482,9 +480,10 @@ void read_grandom(Req* r) { uu = usrs; for (i = 0; i < 64; i++) { if ((*uu) != nil && (*uu)->random >= 0) { - reset = 1; + reset = 0; break; } + uu++; } if (reset) { srand(rand());