view growth.c @ 20:17b2bcc42d72 default tip

added check for empty result; minor stuff
author meillo@marmaro.de
date Sun, 27 Jul 2008 21:34:54 +0200
parents 5937504619f2
children
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>
#include "db.h"


int grow_plants() {
	sprintf(query,
			"update field "
			"set age = age+1, size = size+1 "
			);
	if (!db_update(query)) {
		db_error("grow plants");
		return 0;
	}
	return 1;
}


int growth(void) {
	return grow_plants();
}