fix type mismatch for Blob*s, fix grandom
This commit is contained in:
parent
e501297b23
commit
e9839b1663
2 changed files with 5 additions and 6 deletions
4
cart.c
4
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;
|
||||
|
|
7
xrxs.c
7
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());
|
||||
|
|
Loading…
Reference in a new issue