diff growth.c @ 17:5e6c9260913a

lots of cleanups and small fixes
author meillo@marmaro.de
date Wed, 23 Jul 2008 17:14:38 +0200
parents 8db6497d6065
children 5937504619f2
line wrap: on
line diff
--- a/growth.c	Wed Jul 23 16:49:10 2008 +0200
+++ b/growth.c	Wed Jul 23 17:14:38 2008 +0200
@@ -5,14 +5,13 @@
 
 
 void grow_plants() {
-	/* get weather and last environments to calculate the next one */
-	sprintf(query, "update field \
-			set age = age+1, size = size+1 ");
-	stmt = db_query(query);
+	sprintf(query,
+			"update field "
+			"set age = age+1, size = size+1 "
+			);
 	if (!db_update(query)) {
-		printf("E: update failed  ++  %s\n", sqlite3_errmsg(db));
+		db_error("grow plants");
 	}
-	sqlite3_finalize(stmt);
 }