diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2016-09-14 11:17:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 11:17:58 +0200 |
commit | 2d88def9593b9809c71039bee67bea150ddd3598 (patch) | |
tree | bc03e083cf558d286141b24bc72c1855325efd73 /src/basic | |
parent | 34210af7c63640fca1fd4a09fc23b01a8cd70bf3 (diff) | |
parent | e031c227cbbe7243212ecb38a6db105a93655eae (diff) |
Merge pull request #4133 from keszybz/strerror-removal
Strerror removal and other janitorial cleanups
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/string-util.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 5d4510e1b3..dc7de5dab8 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -443,7 +443,7 @@ static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_le if (old_length <= 3 || old_length <= new_length) return strndup(s, old_length); - r = new0(char, new_length+1); + r = new0(char, new_length+3); if (!r) return NULL; @@ -453,12 +453,12 @@ static char *ascii_ellipsize_mem(const char *s, size_t old_length, size_t new_le x = new_length - 3; memcpy(r, s, x); - r[x] = '.'; - r[x+1] = '.'; - r[x+2] = '.'; + r[x] = 0xe2; /* tri-dot ellipsis: … */ + r[x+1] = 0x80; + r[x+2] = 0xa6; memcpy(r + x + 3, - s + old_length - (new_length - x - 3), - new_length - x - 3); + s + old_length - (new_length - x - 1), + new_length - x - 1); return r; } |