cederom commented on code in PR #3117: URL: https://github.com/apache/nuttx-apps/pull/3117#discussion_r2179925668
########## system/nxplayer/nxplayer.c: ########## @@ -221,18 +220,35 @@ static int _open_with_http(const char *fullurl) FAR struct hostent *he; he = gethostbyname(hostname); + if (!he) + { + close(s); + return -ENETUNREACH; /* DNS resolution failed */ + } memcpy(&server.sin_addr.s_addr, he->h_addr, sizeof(in_addr_t)); - n = connect(s, (struct sockaddr *)&server, sizeof(struct sockaddr_in)); - if (-1 == n) { + int err = errno; close(s); - return -1; + switch (err) Review Comment: Please take a look what switch format is preferred https://nuttx.apache.org/docs/latest/contributing/coding_style.html#switch-statement -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org