garten
view growth.c @ 20:17b2bcc42d72
added check for empty result; minor stuff
author | meillo@marmaro.de |
---|---|
date | Sun, 27 Jul 2008 21:34:54 +0200 |
parents | 5e6c9260913a |
children |
line source
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "db.h"
6 int grow_plants() {
7 sprintf(query,
8 "update field "
9 "set age = age+1, size = size+1 "
10 );
11 if (!db_update(query)) {
12 db_error("grow plants");
13 return 0;
14 }
15 return 1;
16 }
19 int growth(void) {
20 return grow_plants();
21 }