[riot-notifications] [RIOT-OS/RIOT] net/sock_util: Accept NULL pointers in urlsplit (#11677)

Sebastian Meiling notifications at github.com
Wed Jun 12 09:25:46 CEST 2019


smlng requested changes on this pull request.

otherwise tested pre-ACK, works!

> @@ -116,30 +117,33 @@ static char* _find_pathstart(const char *url)
 
 int sock_urlsplit(const char *url, char *hostport, char *urlpath)
 {
+    assert(url != NULL);
     char *hoststart = _find_hoststart(url);
     if (!hoststart) {

as you changed the others this should be `if (hoststart == NULL) {` accordingly, or change back as suggested by @kaspar030 - but be consistent

> @@ -116,30 +117,33 @@ static char* _find_pathstart(const char *url)
 
 int sock_urlsplit(const char *url, char *hostport, char *urlpath)
 {
+    assert(url != NULL);

this addition should be reflected in the documentation as follows:

```
@param[in]   url         URL to split. Not Null.
[...]
@pre `url != NULL`
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11677#pullrequestreview-248584019
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190612/72999a1a/attachment-0001.html>


More information about the notifications mailing list