diff options
author | Pawel Kowalski <p.kowalski2@partner.samsung.com> | 2019-08-28 14:31:23 +0200 |
---|---|---|
committer | Pawel Kowalski <p.kowalski2@partner.samsung.com> | 2019-08-28 16:56:31 +0200 |
commit | dee455252ad321c660b411b4ecd65aa5e08f8fc1 (patch) | |
tree | b55f9ec039e963e42605e9e9bdc186354cf9df42 /src/asn1Parser.c | |
parent | 5c7e0aaf17a296535495e3431db6a86ad64064b3 (diff) | |
parent | 26bea900a531662c6028ecc06f4adea825658434 (diff) | |
download | libtasn1-tizen_5.5.tar.gz libtasn1-tizen_5.5.tar.bz2 libtasn1-tizen_5.5.zip |
Merge tag 'upstream/4.14' into tizentizen_6.5.m2_releasetizen_6.0.m2_releasetizen_5.5.m2_releasesubmit/tizen_6.5/20211028.163501submit/tizen_6.0_hotfix/20201103.115102submit/tizen_6.0_hotfix/20201102.192902submit/tizen_6.0/20201029.205502submit/tizen_5.5_wearable_hotfix/20201026.184307submit/tizen_5.5_mobile_hotfix/20201026.185107submit/tizen_5.5/20191031.000007submit/tizen/20190904.070216submit/tizen/20190829.061506accepted/tizen/unified/20190904.110630accepted/tizen/6.5/unified/20211029.014057accepted/tizen/6.0/unified/hotfix/20201103.050702accepted/tizen/6.0/unified/hotfix/20201102.234932accepted/tizen/6.0/unified/20201030.110146accepted/tizen/5.5/unified/wearable/hotfix/20201027.100357accepted/tizen/5.5/unified/mobile/hotfix/20201027.074057accepted/tizen/5.5/unified/20191031.011500tizen_6.5tizen_6.0_hotfixtizen_6.0tizen_5.5_wearable_hotfixtizen_5.5_tvtizen_5.5_mobile_hotfixtizen_5.5accepted/tizen_6.5_unifiedaccepted/tizen_6.0_unified_hotfixaccepted/tizen_6.0_unifiedaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified_mobile_hotfixaccepted/tizen_5.5_unified
Change-Id: I6d4b47b2072db8e7c45daa6e269e2f0cc6f54a7f
Diffstat (limited to 'src/asn1Parser.c')
-rw-r--r-- | src/asn1Parser.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/asn1Parser.c b/src/asn1Parser.c index 475bfc9..b6844a8 100644 --- a/src/asn1Parser.c +++ b/src/asn1Parser.c @@ -25,11 +25,11 @@ #include <stdlib.h> #include <unistd.h> #include <getopt.h> +#include <assert.h> #include <libtasn1.h> -#include <progname.h> -#include <version-etc.h> +#define program_name "asn1Parser" /* This feature is available in gcc versions 2.5 and later. */ #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) @@ -58,7 +58,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ -n, --name=NAME array name\n\ -h, --help display this help and exit\n\ -v, --version output version information and exit\n"); - emit_bug_reporting_address (); + printf ("Report bugs to "PACKAGE_BUGREPORT); } exit (status); } @@ -84,8 +84,6 @@ main (int argc, char *argv[]) char errorDescription[ASN1_MAX_ERROR_DESCRIPTION_SIZE]; int parse_result = ASN1_SUCCESS; - set_program_name (argv[0]); - opterr = 0; /* disable error messages from getopt */ while (1) @@ -111,8 +109,9 @@ main (int argc, char *argv[]) usage (EXIT_SUCCESS); break; case 'v': /* VERSION */ - version_etc (stdout, program_name, PACKAGE, VERSION, - "Fabio Fiorina", NULL); + printf(program_name" "PACKAGE" " VERSION"\n"); + printf("Copyright (C) 2017-2019 Free Software Foundation, Inc.\n\n"); + printf("Written by Fabio Fiorina\n"); free (outputFileName); free (vectorName); exit (0); @@ -121,12 +120,22 @@ main (int argc, char *argv[]) checkSyntaxOnly = 1; break; case 'o': /* OUTPUT */ - outputFileName = (char *) malloc (strlen (optarg) + 1); - strcpy (outputFileName, optarg); + assert(optarg != NULL); + outputFileName = strdup(optarg); + if (outputFileName == NULL) + { + fprintf(stderr, "Memory error\n"); + exit(1); + } break; case 'n': /* VECTOR NAME */ - vectorName = (char *) malloc (strlen (optarg) + 1); - strcpy (vectorName, optarg); + assert(optarg != NULL); + vectorName = strdup(optarg); + if (vectorName == NULL) + { + fprintf(stderr, "Memory error\n"); + exit(1); + } break; case '?': /* UNKNOW OPTION */ fprintf (stderr, |