Commit 67b720f4 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Darek Stojaczyk
Browse files

examples/sock: Improve error check of input parsing by spdk_strtol

parent 0f9dc2af
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -98,7 +98,11 @@ static int hello_sock_parse_arg(int ch, char *arg)
		g_host = arg;
		break;
	case 'P':
		g_port = atoi(arg);
		g_port = spdk_strtol(arg, 10);
		if (g_port < 0) {
			fprintf(stderr, "Invalid port ID\n");
			return g_port;
		}
		break;
	case 'S':
		g_is_server = 1;