garten

annotate 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
rev   line source
meillo@7 1 #include <stdio.h>
meillo@7 2 #include <stdlib.h>
meillo@7 3 #include "db.h"
meillo@7 4
meillo@7 5
meillo@18 6 int grow_plants() {
meillo@17 7 sprintf(query,
meillo@17 8 "update field "
meillo@17 9 "set age = age+1, size = size+1 "
meillo@17 10 );
meillo@12 11 if (!db_update(query)) {
meillo@17 12 db_error("grow plants");
meillo@18 13 return 0;
meillo@7 14 }
meillo@18 15 return 1;
meillo@7 16 }
meillo@7 17
meillo@7 18
meillo@18 19 int growth(void) {
meillo@18 20 return grow_plants();
meillo@7 21 }