comparison src/c/urweb.c @ 2054:4ad46302f659

Don't use uw_malloc() or equivalent in generating error messages while parsing HTTP request
author Adam Chlipala <adam@chlipala.net>
date Fri, 15 Aug 2014 18:25:56 -0400
parents ced78ef1c82f
children a9159911c3ba
comparison
equal deleted inserted replaced
2053:229a299d739d 2054:4ad46302f659
1041 1041
1042 int uw_set_file_input(uw_context ctx, const char *name, uw_Basis_file f) { 1042 int uw_set_file_input(uw_context ctx, const char *name, uw_Basis_file f) {
1043 int n = ctx->app->input_num(name); 1043 int n = ctx->app->input_num(name);
1044 1044
1045 if (n < 0) { 1045 if (n < 0) {
1046 uw_set_error(ctx, "Bad file input name %s", uw_Basis_htmlifyString(ctx, name)); 1046 uw_set_error(ctx, "Bad file input name");
1047 return -1; 1047 return -1;
1048 } 1048 }
1049 1049
1050 if (n >= ctx->app->inputs_len) { 1050 if (n >= ctx->app->inputs_len) {
1051 uw_set_error(ctx, "For file input name %s, index %d is out of range", uw_Basis_htmlifyString(ctx, name), n); 1051 uw_set_error(ctx, "For file input name, index %d is out of range", n);
1052 return -1; 1052 return -1;
1053 } 1053 }
1054 1054
1055 ctx->inputs[n].kind = FIL; 1055 ctx->inputs[n].kind = FIL;
1056 ctx->inputs[n].data.file = f; 1056 ctx->inputs[n].data.file = f;