Append a WHERE clause fragment, joining with AND if not the first. */
| 6976 | |
| 6977 | /* Append a WHERE clause fragment, joining with AND if not the first. */ |
| 6978 | static int where_append(char *where, int where_sz, int wlen, int *nparams, const char *cond) { |
| 6979 | if (*nparams > 0) { |
| 6980 | wlen += snprintf(where + wlen, where_sz - wlen, " AND "); |
| 6981 | } |
| 6982 | wlen += snprintf(where + wlen, where_sz - wlen, "%s", cond); |
| 6983 | (*nparams)++; |
| 6984 | return wlen; |
| 6985 | } |
| 6986 | |
| 6987 | /* Bind a text parameter and increment the bind index. */ |
| 6988 | static void where_bind_text(search_bind_t *binds, int *bind_idx, const char *val) { |
no outgoing calls
no test coverage detected