Commit 7818939c authored by Pawel Wodkowski's avatar Pawel Wodkowski Committed by Jim Harris
Browse files

util: make spdk_parse_ip_addr return -EINVAL instead -1



Change-Id: Idcdaeb5603c5fbe369884ced52e569cc3149be39
Signed-off-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/429228


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 0c2a320b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ size_t spdk_strlen_pad(const void *str, size_t size, int pad);
 * \param port Will point to the start of the port within ip. The string will be
 * null terminated.
 *
 * \return 0 on success. -1 on failure.
 * \return 0 on success. -EINVAL on failure.
 */
int spdk_parse_ip_addr(char *ip, char **host, char **port);

+3 −3
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ spdk_parse_ip_addr(char *ip, char **host, char **port)
	char *p;

	if (ip == NULL) {
		return -1;
		return -EINVAL;
	}

	*host = NULL;
@@ -267,7 +267,7 @@ spdk_parse_ip_addr(char *ip, char **host, char **port)
		/* IPv6 */
		p = strchr(ip, ']');
		if (p == NULL) {
			return -1;
			return -EINVAL;
		}
		*host = &ip[1];
		*p = '\0';
@@ -276,7 +276,7 @@ spdk_parse_ip_addr(char *ip, char **host, char **port)
		if (*p == '\0') {
			return 0;
		} else if (*p != ':') {
			return -1;
			return -EINVAL;
		}

		p++;