net: make SSCANF_TO_KSTRTO happy

This commit is contained in:
Thomas Schoebel-Theuer 2014-06-29 00:02:40 +02:00 committed by Thomas Schoebel-Theuer
parent 9b39888cb2
commit 11728ec480
1 changed files with 2 additions and 2 deletions

View File

@ -293,8 +293,8 @@ int mars_create_sockaddr(struct sockaddr_storage *addr, const char *spec)
/*empty*/;
if (*tmp_spec) {
int port = 0;
status = sscanf(tmp_spec, "%d", &port);
if (status != 1) {
status = kstrtoint(tmp_spec, 10, &port);
if (unlikely(status)) {
MARS_ERR("invalid sockaddr PORT syntax '%s', status = %d\n", tmp_spec, status);
status = -EINVAL;
goto done;