mirror of https://gerrit.osmocom.org/libosmocore
logging: fix coding style issues in _output_buf()
Change-Id: Ia794dbf51045361ee40815f708344c88abe87a96
This commit is contained in:
parent
eff0880f3b
commit
e56f1b67f4
|
@ -580,19 +580,19 @@ static int _output_buf(char *buf, int buf_len, struct log_target *target, unsign
|
||||||
* message in '\n'. If so, nip the last '\n' away, insert the source file info and re-append an
|
* message in '\n'. If so, nip the last '\n' away, insert the source file info and re-append an
|
||||||
* '\n'. All this to allow LOGP("start..."); LOGPC("...end\n") constructs. */
|
* '\n'. All this to allow LOGP("start..."); LOGPC("...end\n") constructs. */
|
||||||
if (target->print_filename_pos == LOG_FILENAME_POS_LINE_END
|
if (target->print_filename_pos == LOG_FILENAME_POS_LINE_END
|
||||||
&& offset > 0 && buf[offset-1] == '\n') {
|
&& offset > 0 && buf[offset - 1] == '\n') {
|
||||||
switch (target->print_filename2) {
|
switch (target->print_filename2) {
|
||||||
case LOG_FILENAME_NONE:
|
case LOG_FILENAME_NONE:
|
||||||
break;
|
break;
|
||||||
case LOG_FILENAME_PATH:
|
case LOG_FILENAME_PATH:
|
||||||
offset --;
|
offset--;
|
||||||
ret = snprintf(buf + offset, rem, " (%s:%d)\n", file, line);
|
ret = snprintf(buf + offset, rem, " (%s:%d)\n", file, line);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
OSMO_SNPRINTF_RET(ret, rem, offset, len);
|
OSMO_SNPRINTF_RET(ret, rem, offset, len);
|
||||||
break;
|
break;
|
||||||
case LOG_FILENAME_BASENAME:
|
case LOG_FILENAME_BASENAME:
|
||||||
offset --;
|
offset--;
|
||||||
ret = snprintf(buf + offset, rem, " (%s:%d)\n", const_basename(file), line);
|
ret = snprintf(buf + offset, rem, " (%s:%d)\n", const_basename(file), line);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Reference in New Issue