sqlite3_extended_result_codes(db, 1);
+ if (snapshot_scheme == NULL)
+ snapshot_scheme = "";
+
/* Insert this snapshot into the database, and determine the integer key
* which will be used to identify it. */
sqlite3_stmt *stmt = Prepare("insert into "
"values (?, ?, julianday('now'), ?)");
sqlite3_bind_text(stmt, 1, snapshot_name, strlen(snapshot_name),
SQLITE_TRANSIENT);
- if (snapshot_scheme == NULL)
- sqlite3_bind_null(stmt, 2);
- else
- sqlite3_bind_text(stmt, 2, snapshot_scheme, strlen(snapshot_scheme),
- SQLITE_TRANSIENT);
+ sqlite3_bind_text(stmt, 2, snapshot_scheme, strlen(snapshot_scheme),
+ SQLITE_TRANSIENT);
sqlite3_bind_double(stmt, 3, intent);
rc = sqlite3_step(stmt);