summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-04-27 00:35:20 +0200
committerJo-Philipp Wich <jo@mein.io>2021-04-27 12:18:32 +0200
commit64eec7f90e945696572ee076b75d1f35e8f2248a (patch)
treef61121e8f89e39787a960e621fc8492e57fc4bc0 /main.c
parent4af803d76e4c08ff5661c2b37dbd333f3aba866d (diff)
treewide: ISO C / pedantic compliance
- Shuffle typedefs to avoid need for non-compliant forward declarations - Fix non-compliant empty struct initializers - Remove use of braced expressions - Remove use of anonymous unions - Avoid `void *` pointer arithmetic - Fix several warnings reported by gcc -pedantic mode and clang 11 compilation Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.c b/main.c
index 618d5e4..d291447 100644
--- a/main.c
+++ b/main.c
@@ -98,7 +98,7 @@ parse(uc_parse_config *config, uc_source *src,
{
uc_value_t *globals = NULL;
uc_function_t *entry;
- uc_vm vm = {};
+ uc_vm vm = { 0 };
int c, c2, rc = 0;
char *err;
@@ -285,7 +285,12 @@ main(int argc, char **argv)
if (source)
fprintf(stderr, "Options -i and -s are exclusive\n");
- source = uc_source_new_buffer("[-s argument]", xstrdup(optarg), strlen(optarg));
+ c = xstrdup(optarg);
+ source = uc_source_new_buffer("[-s argument]", c, strlen(c));
+
+ if (!source)
+ free(c);
+
break;
case 'S':