[BACK]Return to format.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/format.c between version 1.104 and 1.105

version 1.104, 2016/01/19 15:59:12 version 1.105, 2016/01/31 09:54:46
Line 684 
Line 684 
         char            *copy, *copy0, *endptr, *ptr, *found, *new, *value;          char            *copy, *copy0, *endptr, *ptr, *found, *new, *value;
         char            *from = NULL, *to = NULL;          char            *from = NULL, *to = NULL;
         size_t           valuelen, newlen, fromlen, tolen, used;          size_t           valuelen, newlen, fromlen, tolen, used;
         u_long           limit = 0;          long             limit = 0;
         int              modifiers = 0, brackets;          int              modifiers = 0, brackets;
   
         /* Make a copy of the key. */          /* Make a copy of the key. */
Line 696 
Line 696 
         switch (copy[0]) {          switch (copy[0]) {
         case '=':          case '=':
                 errno = 0;                  errno = 0;
                 limit = strtoul(copy + 1, &endptr, 10);                  limit = strtol(copy + 1, &endptr, 10);
                 if (errno == ERANGE && limit == ULONG_MAX)                  if (errno == ERANGE && (limit == LONG_MIN || limit == LONG_MAX))
                         break;                          break;
                 if (*endptr != ':')                  if (*endptr != ':')
                         break;                          break;
Line 813 
Line 813 
         }          }
   
         /* Truncate the value if needed. */          /* Truncate the value if needed. */
         if (limit != 0) {          if (limit > 0) {
                 new = utf8_trimcstr(value, limit);                  new = utf8_trimcstr(value, limit);
                   free(value);
                   value = new;
           } else if (limit < 0) {
                   new = utf8_rtrimcstr(value, -limit);
                 free(value);                  free(value);
                 value = new;                  value = new;
         }          }

Legend:
Removed from v.1.104  
changed lines
  Added in v.1.105