mirror of
https://github.com/curl/curl.git
synced 2026-05-19 21:56:22 +03:00
parent
f81e7197c1
commit
37d871af01
1 changed files with 2 additions and 4 deletions
|
|
@ -36,6 +36,7 @@
|
|||
#include "tool_main.h"
|
||||
#include "tool_stderr.h"
|
||||
#include "tool_help.h"
|
||||
#include "tool_strdup.h"
|
||||
#include "var.h"
|
||||
|
||||
#define ALLOW_BLANK TRUE
|
||||
|
|
@ -69,13 +70,10 @@ static ParameterError getstrn(char **str, const char *val,
|
|||
if(!allowblank && !val[0])
|
||||
return PARAM_BLANK_STRING;
|
||||
|
||||
*str = curlx_malloc(len + 1);
|
||||
*str = memdup0(val, len);
|
||||
if(!*str)
|
||||
return PARAM_NO_MEM;
|
||||
|
||||
memcpy(*str, val, len);
|
||||
(*str)[len] = 0; /* null-terminate */
|
||||
|
||||
return PARAM_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue