|
@@ -168,9 +168,9 @@ int db_do_insert(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
|
|
|
if (ret < 0) return -1;
|
|
|
off += ret;
|
|
|
|
|
|
- if (off + 2 >= SQL_BUF_LEN) goto error;
|
|
|
+ if (off + 2 > SQL_BUF_LEN) goto error;
|
|
|
sql_buf[off++] = ')';
|
|
|
- sql_buf[off + 1] = '\0';
|
|
|
+ sql_buf[off] = '\0';
|
|
|
sql_str.s = sql_buf;
|
|
|
sql_str.len = off;
|
|
|
|
|
@@ -212,8 +212,8 @@ int db_do_delete(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
|
|
|
if (ret < 0) return -1;
|
|
|
off += ret;
|
|
|
}
|
|
|
- if (off + 1 >= SQL_BUF_LEN) goto error;
|
|
|
- sql_buf[off + 1] = '\0';
|
|
|
+ if (off + 1 > SQL_BUF_LEN) goto error;
|
|
|
+ sql_buf[off] = '\0';
|
|
|
sql_str.s = sql_buf;
|
|
|
sql_str.len = off;
|
|
|
|
|
@@ -258,8 +258,8 @@ int db_do_update(const db_con_t* _h, const db_key_t* _k, const db_op_t* _o,
|
|
|
if (ret < 0) return -1;
|
|
|
off += ret;
|
|
|
}
|
|
|
- if (off + 1 >= SQL_BUF_LEN) goto error;
|
|
|
- sql_buf[off + 1] = '\0';
|
|
|
+ if (off + 1 > SQL_BUF_LEN) goto error;
|
|
|
+ sql_buf[off] = '\0';
|
|
|
sql_str.s = sql_buf;
|
|
|
sql_str.len = off;
|
|
|
|
|
@@ -303,9 +303,9 @@ int db_do_replace(const db_con_t* _h, const db_key_t* _k, const db_val_t* _v,
|
|
|
if (ret < 0) return -1;
|
|
|
off += ret;
|
|
|
|
|
|
- if (off + 2 >= SQL_BUF_LEN) goto error;
|
|
|
+ if (off + 2 > SQL_BUF_LEN) goto error;
|
|
|
sql_buf[off++] = ')';
|
|
|
- sql_buf[off + 1] = '\0';
|
|
|
+ sql_buf[off] = '\0';
|
|
|
sql_str.s = sql_buf;
|
|
|
sql_str.len = off;
|
|
|
|