<p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/24592">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bts/+/24592/2/src/common/scheduler.c">File src/common/scheduler.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bts/+/24592/2/src/common/scheduler.c@625">Patch Set #2, Line 625:</a> <code style="font-family:monospace,monospace">  osmo_talloc_replace_string_fmt(l1ts->ctrs, &l1ts->ctrs->name,</code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">isn't there an API to set the field?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">There is rate_ctr_group_set_name() which accepts a constant string. I need a format string. That's why I introduced rate_ctr_group_set_name_fmt(). Then I was recommended to introduce a generic function for that, and this is what I did.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Why aren't you simply using talloc_snprintf or alike and passing it to the proper API?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Again, because your API _duplicates_ the given string using talloc_strdup(), so I would need to allocate a string, pass it to rate_ctr_group_set_name() and then free() it. This looks ugly to me.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bts/+/24592">change 24592</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bts/+/24592"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bts </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie872ab37661fa5d44f219f59c7daaa1033113289 </div>
<div style="display:none"> Gerrit-Change-Number: 24592 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 07 Jun 2021 14:59:39 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>