mirror of https://github.com/schoebel/mars
net: make SSCANF_TO_KSTRTO happy
This commit is contained in:
parent
9b39888cb2
commit
11728ec480
|
@ -293,8 +293,8 @@ int mars_create_sockaddr(struct sockaddr_storage *addr, const char *spec)
|
||||||
/*empty*/;
|
/*empty*/;
|
||||||
if (*tmp_spec) {
|
if (*tmp_spec) {
|
||||||
int port = 0;
|
int port = 0;
|
||||||
status = sscanf(tmp_spec, "%d", &port);
|
status = kstrtoint(tmp_spec, 10, &port);
|
||||||
if (status != 1) {
|
if (unlikely(status)) {
|
||||||
MARS_ERR("invalid sockaddr PORT syntax '%s', status = %d\n", tmp_spec, status);
|
MARS_ERR("invalid sockaddr PORT syntax '%s', status = %d\n", tmp_spec, status);
|
||||||
status = -EINVAL;
|
status = -EINVAL;
|
||||||
goto done;
|
goto done;
|
||||||
|
|
Loading…
Reference in New Issue