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

Leandro Lanzieri notifications at github.com
Tue Jun 11 17:44:30 CEST 2019

### Contribution description
This PR modifies the implementation of `sock_urlsplit` so it can accept NULL pointers for either the address and/or the path part. This way it's more flexible to use, as one does not have to allocate a buffer for both parts if one of them is not needed.

There are also two new unit tests for testing this conditions.

### Testing procedure
Run the unit tests:
cd tests/unittests
make tests-sock_util test
### Issues/PRs references
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * sys/net/sock_util: Accept null pointers in urlsplit
  * unitttests/sock_util: Test null pointer in urlsplit

-- File Changes --

    M sys/include/net/sock/util.h (6)
    M sys/net/sock/sock_util.c (32)
    M tests/unittests/tests-sock_util/tests-sock_util.c (14)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190611/3f94d4e9/attachment.html>

More information about the notifications mailing list