chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e64d523
)
core: check asprintf return value
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sat, 14 Mar 2015 02:21:52 +0000
(21:21 -0500)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sat, 14 Mar 2015 03:42:17 +0000
(23:42 -0400)
CID #
1261729
.
src/core/manager.c
patch
|
blob
|
history
diff --git
a/src/core/manager.c
b/src/core/manager.c
index 24a66a28af8b1117f0a56215b7f44e9c9eabce74..d92e048e2468cf61ababfd9d4c310d305b3d6315 100644
(file)
--- a/
src/core/manager.c
+++ b/
src/core/manager.c
@@
-178,8
+178,10
@@
static void manager_print_jobs_in_progress(Manager *m) {
m->jobs_in_progress_iteration++;
- if (m->n_running_jobs > 1)
- asprintf(&job_of_n, "(%u of %u) ", counter, m->n_running_jobs);
+ if (m->n_running_jobs > 1) {
+ if (asprintf(&job_of_n, "(%u of %u) ", counter, m->n_running_jobs) < 0)
+ job_of_n = NULL;
+ }
format_timespan(time, sizeof(time), now(CLOCK_MONOTONIC) - j->begin_usec, 1*USEC_PER_SEC);
if (job_get_timeout(j, &x) > 0)