| 2273 | //************************************************************************************* |
| 2274 | //************************************************************************************* |
| 2275 | SCRIPT_VAR * SETVarValueText(SCRIPT_VAR ** svf, long * nb, char * name, char * val) |
| 2276 | { |
| 2277 | SCRIPT_VAR * tsv; |
| 2278 | tsv = GetVarAddress(*svf, nb, name); |
| 2279 | |
| 2280 | if (!tsv) |
| 2281 | { |
| 2282 | tsv = GetFreeVarSlot(svf, nb); |
| 2283 | |
| 2284 | if (!tsv) |
| 2285 | return NULL; |
| 2286 | |
| 2287 | tsv->text = NULL; |
| 2288 | strcpy(tsv->name, name); |
| 2289 | } |
| 2290 | |
| 2291 | if (tsv->text) |
| 2292 | { |
| 2293 | free((void *)tsv->text); |
| 2294 | tsv->text = NULL; |
| 2295 | } |
| 2296 | |
| 2297 | tsv->ival = strlen(val) + 1; |
| 2298 | |
| 2299 | if (tsv->ival) |
| 2300 | tsv->text = strdup(val); |
| 2301 | else |
| 2302 | tsv->text = NULL; |
| 2303 | |
| 2304 | |
| 2305 | return tsv; |
| 2306 | } |
| 2307 | |
| 2308 | SCRIPT_EVENT AS_EVENT[] = |
| 2309 | { |
no test coverage detected