Handle out-of-memory conditions more gracefully.
modified libpkg/pkg_printf.c
@@ -81,12 +81,14 @@ free_percent_esc(struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -468,6 +470,23 @@ int_val(struct sbuf *sbuf, int64_t value, struct percent_esc *p)
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -508,9 +527,10 @@ format_shlibs(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -621,7 +641,7 @@ format_options(struct sbuf *sbuf, struct pkg *pkg, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -644,20 +664,9 @@ static struct sbuf *
|
|
|
|
|
|
| - | |
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|
@@ -921,7 +930,7 @@ parse_escape(const char *f, struct percent_esc *p)
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1021,6 +1030,9 @@ process_format(struct sbuf *sbuf, const char *f, struct pkg *pkg)
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -1125,12 +1137,15 @@ pkg_printf(const char *fmt, struct pkg *pkg)
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -1146,12 +1161,15 @@ pkg_fprintf(FILE *stream, const char *fmt, struct pkg *pkg)
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -1169,12 +1187,15 @@ pkg_dprintf(int fd, const char *fmt, struct pkg *pkg)
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -1194,12 +1215,15 @@ pkg_snprintf(char *str, size_t size, const char *fmt, struct pkg *pkg)
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -1218,15 +1242,17 @@ pkg_asprintf(char **ret, const char *fmt, struct pkg *pkg)
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -1251,6 +1277,10 @@ pkg_sbuf_printf(struct sbuf *sbuf, const char *fmt, struct pkg *pkg)
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|