projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add vendor/fmt
[lttng-tools.git]
/
src
/
common
/
utils.cpp
diff --git
a/src/common/utils.cpp
b/src/common/utils.cpp
index eb6b001434300594b3f0af974f565b0d2301959c..b4b7f749f1ef1a6e5286225437f639d01f2966d2 100644
(file)
--- a/
src/common/utils.cpp
+++ b/
src/common/utils.cpp
@@
-171,9
+171,8
@@
void utils_close_pipe(int *src)
*/
char *utils_strdupdelim(const char *begin, const char *end)
{
*/
char *utils_strdupdelim(const char *begin, const char *end)
{
- char *str;
+ char *str
= zmalloc<char>(end - begin + 1)
;
- str = (char *) zmalloc(end - begin + 1);
if (str == NULL) {
PERROR("zmalloc strdupdelim");
goto error;
if (str == NULL) {
PERROR("zmalloc strdupdelim");
goto error;
@@
-784,7
+783,7
@@
char *utils_get_user_home_dir(uid_t uid)
goto end;
}
retry:
goto end;
}
retry:
- buf =
(char *) zmalloc
(buflen);
+ buf =
zmalloc<char>
(buflen);
if (!buf) {
goto end;
}
if (!buf) {
goto end;
}
@@
-934,7
+933,7
@@
char *utils_generate_optstring(const struct option *long_options,
string_len += long_options[i].has_arg ? 1 : 0;
}
string_len += long_options[i].has_arg ? 1 : 0;
}
- optstring =
(char *) zmalloc
(string_len);
+ optstring =
zmalloc<char>
(string_len);
if (!optstring) {
goto end;
}
if (!optstring) {
goto end;
}
@@
-1159,7
+1158,7
@@
enum lttng_error_code utils_user_id_from_name(const char *user_name, uid_t *uid)
buflen = FALLBACK_USER_BUFLEN;
}
buflen = FALLBACK_USER_BUFLEN;
}
- buf =
(char *) zmalloc
(buflen);
+ buf =
zmalloc<char>
(buflen);
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
@@
-1173,7
+1172,7
@@
enum lttng_error_code utils_user_id_from_name(const char *user_name, uid_t *uid)
case ERANGE:
buflen *= 2;
free(buf);
case ERANGE:
buflen *= 2;
free(buf);
- buf =
(char *) zmalloc
(buflen);
+ buf =
zmalloc<char>
(buflen);
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
@@
-1224,7
+1223,7
@@
enum lttng_error_code utils_group_id_from_name(
buflen = FALLBACK_GROUP_BUFLEN;
}
buflen = FALLBACK_GROUP_BUFLEN;
}
- buf =
(char *) zmalloc
(buflen);
+ buf =
zmalloc<char>
(buflen);
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
@@
-1238,7
+1237,7
@@
enum lttng_error_code utils_group_id_from_name(
case ERANGE:
buflen *= 2;
free(buf);
case ERANGE:
buflen *= 2;
free(buf);
- buf =
(char *) zmalloc
(buflen);
+ buf =
zmalloc<char>
(buflen);
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
if (!buf) {
ret_val = LTTNG_ERR_NOMEM;
goto end;
This page took
0.025334 seconds
and
4
git commands to generate.