diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-22 22:12:55 -0400 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-22 22:20:31 -0400 | 
| commit | 5054264d93bff2ad54d909d796e93f3081ee9703 (patch) | |
| tree | 626cb03921882c90372e93a4684b56bb79d0bab0 /src | |
| parent | 22e4934dc0184a2e50eb80d5890c1a16613ff821 (diff) | |
| download | stasis-5054264d93bff2ad54d909d796e93f3081ee9703.tar.gz | |
Error messages
Diffstat (limited to 'src')
| -rw-r--r-- | src/template.c | 4 | ||||
| -rw-r--r-- | src/utils.c | 6 | 
2 files changed, 4 insertions, 6 deletions
| diff --git a/src/template.c b/src/template.c index e046350..72c045b 100644 --- a/src/template.c +++ b/src/template.c @@ -30,7 +30,7 @@ void tpl_register(char *key, char **ptr) {      struct tpl_item *item = NULL;      item = calloc(1, sizeof(*item));      if (!item) { -        perror("unable to register tpl_item"); +        SYSERROR("unable to register tpl_item for %s", key);          exit(1);      }      item->key = strdup(key); @@ -47,7 +47,7 @@ void tpl_free() {                  SYSERROR("freeing template item key: %s", item->key);                  guard_free(item->key);              } -            free(item); +            SYSERROR("freeing template item: %p", item);              item->ptr = NULL;          }          guard_free(item); diff --git a/src/utils.c b/src/utils.c index da3833c..da340db 100644 --- a/src/utils.c +++ b/src/utils.c @@ -177,14 +177,13 @@ char **file_readlines(const char *filename, size_t start, size_t limit, ReaderFn      if (fp == NULL) {          perror(filename); -        fprintf(SYSERROR); +        SYSERROR("failed to open %s for reading", filename);          return NULL;      }      // Allocate buffer      if ((buffer = calloc(OMC_BUFSIZ, sizeof(char))) == NULL) { -        perror("line buffer"); -        fprintf(SYSERROR); +        SYSERROR("unable to allocate %d bytes for buffer", OMC_BUFSIZ);          if (!use_stdin) {              fclose(fp);          } @@ -579,7 +578,6 @@ int xml_pretty_print_in_place(const char *filename, const char *pretty_print_pro      return 0;      pretty_print_failed: -        fprintf(SYSERROR);          if (fp) {              fclose(fp);          } | 
