summaryrefslogtreecommitdiffstats
path: root/thumbs.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2015-10-28 22:29:01 +0100
committerBert Münnich <ber.t@posteo.de>2015-10-28 22:29:01 +0100
commit851e4288c102cc4177d54d87aded43d003e85885 (patch)
tree6336fa0d4b01426b6e35f0dbed74632855a1e97d /thumbs.c
parentb096cbd536b94ee848b94d873d0c0a898f574af1 (diff)
downloadnsxiv-851e4288c102cc4177d54d87aded43d003e85885.tar.zst
Prefix safe allocation functions with 'e' instead of 's_'
Diffstat (limited to 'thumbs.c')
-rw-r--r--thumbs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/thumbs.c b/thumbs.c
index 949dac9..4790ed9 100644
--- a/thumbs.c
+++ b/thumbs.c
@@ -48,7 +48,7 @@ char* tns_cache_filepath(const char *filepath)
if (strncmp(filepath, cache_dir, strlen(cache_dir)) != 0) {
/* don't cache images inside the cache directory! */
len = strlen(cache_dir) + strlen(filepath) + 2;
- cfile = (char*) s_malloc(len);
+ cfile = (char*) emalloc(len);
snprintf(cfile, len, "%s/%s", cache_dir, filepath + 1);
}
return cfile;
@@ -155,7 +155,7 @@ void tns_init(tns_t *tns, fileinfo_t *files, const int *cnt, int *sel,
const char *homedir, *dsuffix = "";
if (cnt != NULL && *cnt > 0) {
- tns->thumbs = (thumb_t*) s_malloc(*cnt * sizeof(thumb_t));
+ tns->thumbs = (thumb_t*) emalloc(*cnt * sizeof(thumb_t));
memset(tns->thumbs, 0, *cnt * sizeof(thumb_t));
} else {
tns->thumbs = NULL;
@@ -178,7 +178,7 @@ void tns_init(tns_t *tns, fileinfo_t *files, const int *cnt, int *sel,
if (homedir != NULL) {
free(cache_dir);
len = strlen(homedir) + strlen(dsuffix) + 6;
- cache_dir = (char*) s_malloc(len);
+ cache_dir = (char*) emalloc(len);
snprintf(cache_dir, len, "%s%s/sxiv", homedir, dsuffix);
} else {
warn("could not locate thumbnail cache directory");