MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cgiGetTextfield

Function cgiGetTextfield

cgi-bin/var.c:265–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263 */
264
265const char * /* O - Value or NULL */
266cgiGetTextfield(const char *name) /* I - Name of form field */
267{
268 _cgi_var_t *var = cgi_find_variable(name);
269 /* Found variable */
270 const char *value = var ? var->values[var->nvalues - 1] : NULL;
271
272
273 if (value && strchr(value, '\"') != NULL)
274 {
275 /*
276 * Delete the invalid text field value...
277 */
278
279 int i = var - form_vars, j;
280
281 form_count --;
282
283 for (j = 0; j < var->nvalues; j ++)
284 free(var->values[j]);
285 free(var->name);
286 free(var->values);
287
288 if (i < form_count)
289 memmove(var, var + 1, (size_t)(form_count - i) * sizeof(_cgi_var_t));
290
291 value = NULL;
292 }
293
294 return (value ? strdup(value) : NULL);
295}
296
297
298/*

Callers 11

mainFunction · 0.85
show_all_classesFunction · 0.85
show_all_printersFunction · 0.85
do_am_classFunction · 0.85
do_am_printerFunction · 0.85
do_config_serverFunction · 0.85
do_delete_classFunction · 0.85
do_delete_printerFunction · 0.85
do_set_allowed_usersFunction · 0.85
do_set_defaultFunction · 0.85
do_set_optionsFunction · 0.85

Calls 1

cgi_find_variableFunction · 0.85

Tested by

no test coverage detected