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*/; /*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;