Changeset 127:d004b8ad3fff in rrlib_logging


Ignore:
Timestamp:
09.07.2014 14:40:16 (6 years ago)
Author:
Michael Arndt <m_arndt@…>
Branch:
default
Phase:
public
Message:

Optimization: Use return value of snprintf() instead of calling strlen() on the result.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • messages/tFormattingBuffer.cpp

    r126 r127  
    122122{ 
    123123  char control_sequence[16]; 
    124   snprintf(control_sequence, sizeof(control_sequence), "\033[;%u;3%um", effect, color); 
    125   const size_t length = strlen(control_sequence); 
     124  const size_t length = snprintf(control_sequence, sizeof(control_sequence), "\033[;%u;3%um", effect, color); 
    126125  if (is_a_tty) 
    127126  { 
Note: See TracChangeset for help on using the changeset viewer.