all repos — xrxs @ e9839b1663cb0052a845940a52e3c28ea90a1ff1

experimental networked application/game server with 9p

fix type mismatch for Blob*s, fix grandom
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmEE48IACgkQO3+8IhRO
Y5japA/+J+ZhcYFb1hOBZ63Ik67MhOQ0dsiksLQyq8MQ8vF94NsP37TO81MgjhU4
04+TgpxSmLIY+jxYSc4RBEj8hm+i03BcULUWIOxR8IU1zmx3HshSanAkAK6y65do
J9vtWxzWy5hZdxW3Xg6wH35mWgz2nbW4fPvvrRP7r9GQpF+UYpq290B1bM5+dK/V
MkzLfbEhlfESVS0UQqfTY3hBvIlrzXYkYbM7vXMvV2EVWtwtk6h8+PYQURr4PH83
i+NFEZ2vK47HmfN0xfnN+caT0HY2XQEg4FvUREuyTmAXaQwdiLTH7hraYlUbtr1Z
W7GCqMzvK1In1iTtP00JTf2RbsfDGvUeNPPrX9bqC7hbikZ7+0qdNtDI60nHWxjb
xUn55Hu+MUWhOMfo4ZMBJ6SoBYlc7kWIk/ib1HjxC3rDdY+Ce2Xyb7QAZ+qMFmV7
7kKM0yKFfmcUUykE46AiF5euN1WliPaDGMtL8jT1835pxjTf30jk8LfpZE6qu7Rv
/kDVc/LdWKV3H+q+5FZEIlWjsN0LCwMr2b5dpdObjZppV2GOHoosvNgzpaJ65iJH
jFes9wghnINNHqA9UUtjfRL46eqnAoGNcGw48t353iWYi1i4uZhgOJEb136Ua+B3
Nl3gZ6EIlGLsMfz4l0Ld+j4ESU1Wf8bgclqfok5wznOHgK7o8AM=
=+Cqk
-----END PGP SIGNATURE-----
commit

e9839b1663cb0052a845940a52e3c28ea90a1ff1

parent

e501297b23a7d7dcc673f54ec4ebbe31e931b587

2 files changed, 5 insertions(+), 6 deletions(-)

jump to
M cart.ccart.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 @@ UserInfo* u = find_user(table, uname);

char type[8] = {0}; char chunk_id[64] = {0}; char* c = chunk; - char* data; + Blob* data; if (u == nil || u->cart == nil) return 0;
M xrxs.cxrxs.c

@@ -457,12 +457,10 @@ readstr(r, buf);

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 @@ }

uu = usrs; for (i = 0; i < 64; i++) { if ((*uu) != nil && (*uu)->random >= 0) { - reset = 1; + reset = 0; break; } + uu++; } if (reset) { srand(rand());