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

Diff for /src/usr.bin/tmux/utf8.c between version 1.17 and 1.18

version 1.17, 2015/11/12 12:19:57 version 1.18, 2015/11/12 12:43:36
Line 713 
Line 713 
         free(tmp);          free(tmp);
         return (out);          return (out);
 }  }
   
   /* Pad UTF-8 string to width. Caller frees. */
   char *
   utf8_padcstr(const char *s, u_int width)
   {
           size_t   slen;
           char    *out;
           u_int     n, i;
   
           n = utf8_cstrwidth(s);
           if (n >= width)
                   return (xstrdup(s));
   
           slen = strlen(s);
           out = xmalloc(slen + 1 + (width - n));
           memcpy(out, s, slen);
           for (i = n; i < width; i++)
                   out[slen++] = ' ';
           out[slen] = '\0';
           return (out);
   }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18