Changeset 17607 in niluje


Ignore:
Timestamp:
Jul 30, 2020, 8:10:59 PM (12 days ago)
Author:
NiLuJe
Message:

MobiCover:

  • More realpath cleanups
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Configs/trunk/Kindle/Touch_Hacks/MobiCover/LibMobi/mobicover.c

    r17606 r17607  
    191191        } else {
    192192                // Use the sha1 of the full path, like the Kindle
    193                 char abspath[PATH_MAX];
    194                 if (realpath(fullpath, abspath) == NULL) {
     193                char* abspath = NULL;
     194                abspath       = realpath(fullpath, abspath);
     195                if (abspath == NULL) {
    195196                        fprintf(stderr, "Unable to resolve input file's path (realpath: %m)!\n");
     197                        free(abspath);
    196198                        return ERRCODE(EXIT_FAILURE);
    197199                }
     
    205207                char hex_hash[BASE16_ENCODE_LENGTH(SHA1_DIGEST_SIZE)] = { 0 };
    206208                base16_encode_update(hex_hash, SHA1_DIGEST_SIZE, digest);
     209                free(abspath);
    207210
    208211                cdekey = hex_hash;
Note: See TracChangeset for help on using the changeset viewer.