提交 1f920b9f 编写于 作者: P Peter Krempa

util: uri: Convert port number to unsigned integer

Negative ports don't make sense so use a unsigned integer.
上级 e8b69016
......@@ -1356,7 +1356,7 @@ void virStringTrimOptionalNewline(char *str)
*/
int
virStringParsePort(const char *str,
int *port)
unsigned int *port)
{
unsigned int p = 0;
......
......@@ -297,7 +297,7 @@ char *virStringEncodeBase64(const uint8_t *buf, size_t buflen);
void virStringTrimOptionalNewline(char *str);
int virStringParsePort(const char *str,
int *port)
unsigned int *port)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
#endif /* __VIR_STRING_H__ */
......@@ -42,7 +42,7 @@ struct _virURI {
char *scheme; /* the URI scheme */
char *server; /* the server part */
char *user; /* the user part */
int port; /* the port number */
unsigned int port; /* the port number */
char *path; /* the path string */
char *query; /* the query string */
char *fragment; /* the fragment string */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册