chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prep v232: Add libelogind.sym entries for version 232.
[elogind.git]
/
src
/
basic
/
string-util.c
diff --git
a/src/basic/string-util.c
b/src/basic/string-util.c
index 5d4510e1b3bc457103da44e9128cc240588fdc53..6b06e643c99398f6226d788589eeb04c70854abd 100644
(file)
--- 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);
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;
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);
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,
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;
}
return r;
}
@@
-610,8
+610,7
@@
char *strreplace(const char *text, const char *old_string, const char *new_strin
return r;
oom:
return r;
oom:
- free(r);
- return NULL;
+ return mfree(r);
}
char *strip_tab_ansi(char **ibuf, size_t *_isz) {
}
char *strip_tab_ansi(char **ibuf, size_t *_isz) {
@@
-682,8
+681,7
@@
char *strip_tab_ansi(char **ibuf, size_t *_isz) {
if (ferror(f)) {
fclose(f);
if (ferror(f)) {
fclose(f);
- free(obuf);
- return NULL;
+ return mfree(obuf);
}
fclose(f);
}
fclose(f);