Android : re-enable armeabi-v7a, x86, and x86_64. Disabed accidentaly.
authorEdouard Tisserant
Mon, 12 Oct 2015 13:26:19 +0200
changeset 394a872e68c2104
parent 374 a26015b998e8
child 395 450ff541870d
Android : re-enable armeabi-v7a, x86, and x86_64. Disabed accidentaly.
build-android/build.sh
src/mime.c
     1.1 --- a/build-android/build.sh	Sun Oct 11 20:22:17 2015 +0200
     1.2 +++ b/build-android/build.sh	Mon Oct 12 13:26:19 2015 +0200
     1.3 @@ -7,8 +7,7 @@
     1.4  openssl_build_version=1
     1.5  cyrus_sasl_build_version=1
     1.6  libetpan_build_version=1
     1.7 -# archs="armeabi armeabi-v7a x86 x86_64"
     1.8 -archs="armeabi"
     1.9 +archs="armeabi armeabi-v7a x86 x86_64"
    1.10  package_name=pEpEngine-android
    1.11  
    1.12  current_dir="`pwd`"
     2.1 --- a/src/mime.c	Sun Oct 11 20:22:17 2015 +0200
     2.2 +++ b/src/mime.c	Mon Oct 12 13:26:19 2015 +0200
     2.3 @@ -55,18 +55,21 @@
     2.4  
     2.5      if(env_tmp){
     2.6          int tmp_l = strlen(env_tmp);
     2.7 -        int need_sep = (env_tmp[tmp_l-1] != PATH_SEP);
     2.8 -        template = calloc(1, tmp_l + 
     2.9 -                             (need_sep ? 1 : 0) +
    2.10 -                             sizeof(TMP_TEMPLATE));
    2.11 -        if (template == NULL)
    2.12 -            goto enomem;
    2.13 +        if(tmp_l == 0 ) {
    2.14 +            goto err_file;
    2.15 +        } else {
    2.16 +            int need_sep = (env_tmp[tmp_l-1] != PATH_SEP);
    2.17 +            template = calloc(1, tmp_l + 
    2.18 +                                 (need_sep ? 1 : 0) +
    2.19 +                                 sizeof(TMP_TEMPLATE));
    2.20 +            if (template == NULL)
    2.21 +                goto enomem;
    2.22  
    2.23 -        memcpy(template, env_tmp, tmp_l);
    2.24 -        if(need_sep)
    2.25 -            template[tmp_l] = PATH_SEP;
    2.26 -        memcpy(template + tmp_l + (need_sep ? 1 : 0), TMP_TEMPLATE, sizeof(TMP_TEMPLATE));
    2.27 -
    2.28 +            memcpy(template, env_tmp, tmp_l);
    2.29 +            if(need_sep)
    2.30 +                template[tmp_l] = PATH_SEP;
    2.31 +            memcpy(template + tmp_l + (need_sep ? 1 : 0), TMP_TEMPLATE, sizeof(TMP_TEMPLATE));
    2.32 +        }
    2.33      }else{
    2.34          template = strdup("/tmp/" TMP_TEMPLATE);
    2.35          if (template == NULL)