Changeset 4c6de4f in mainline for uspace/lib/c/include/io/klog.h


Ignore:
Timestamp:
2017-12-10T21:51:26Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b07fba
Parents:
68e5406
Message:

Remove unnecessary format string duplication from KLOG_PRINTF() macro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/io/klog.h

    r68e5406 r4c6de4f  
    4848
    4949#define KLOG_PRINTF(lvl, fmt, ...) ({ \
    50         char *_fmt = str_dup(fmt); \
    51         size_t _fmtsize = str_size(_fmt); \
    52         if (_fmtsize > 0 && _fmt[_fmtsize - 1] == '\n') \
    53                 _fmt[_fmtsize - 1] = 0; \
    5450        char *_s; \
    55         int _c = asprintf(&_s, _fmt, ##__VA_ARGS__); \
    56         free(_fmt); \
     51        int _c = asprintf(&_s, fmt, ##__VA_ARGS__); \
    5752        if (_c >= 0) { \
    5853                _c = klog_write((lvl), _s, str_size(_s)); \
Note: See TracChangeset for help on using the changeset viewer.