Change in libosmocore[master]: osmo_escape_str_buf: Always copy, don't return input string pointer

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Mar 29 16:42:15 UTC 2019


Hello Pau Espin Pedrol, Jenkins Builder, 

I'd like you to reexamine a change. Please visit

    https://gerrit.osmocom.org/13447

to look at the new patch set (#2).

Change subject: osmo_escape_str_buf: Always copy, don't return input string pointer
......................................................................

osmo_escape_str_buf: Always copy, don't return input string pointer

osmo_escape_str_buf() used to have the somewhat odd semantics that
if no escaping was needed, it would return the original pointer without
making any copy to the output buffer.  While this seems like an elegant
optimization, it is a very strange behavior and it works differently
than all of our other *_buf() functions.  Let's unify the API and
turn osmo_escape_str_buf() into a strlcpy() if no escaping is needed.

Change-Id: I3a02bdb27008a73101c2db41ac04248960ed4064
---
M include/osmocom/core/utils.h
M src/utils.c
M tests/utils/utils_test.c
M tests/utils/utils_test.ok
4 files changed, 10 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/13447/2
-- 
To view, visit https://gerrit.osmocom.org/13447
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3a02bdb27008a73101c2db41ac04248960ed4064
Gerrit-Change-Number: 13447
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190329/6ec6350f/attachment.html>


More information about the gerrit-log mailing list