X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=vms%2Fvms.c;fp=vms%2Fvms.c;h=3383ee9a4e7f78bda48c31ee7917d18d2d81f1ad;hb=c7e61475680fa226bd9b8bdd469cd66914e630f5;hp=51b891a22fbc17c5a42ab09e2d12d0e21871d101;hpb=800deb09b422a73c1212233a93839a223ff59678;p=debian%2Fgzip diff --git a/vms/vms.c b/vms/vms.c index 51b891a..3383ee9 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -6,6 +6,7 @@ * and updated by Jean-loup Gailly. */ +#include #include static char **vms_argv = NULL; @@ -25,8 +26,8 @@ vms_expand_args(old_argc, argv) int new_argc = 0; int context, status; char buf[255], *p; - - vms_argv = (char**)xmalloc((max_files+1)*sizeof(char*)); + + vms_argv = xmalloc((max_files+1)*sizeof(char*)); vms_argv[new_argc++] = **argv; @@ -38,7 +39,7 @@ vms_expand_args(old_argc, argv) } else { /* Files */ context = 0; if (find_file_c(argv[0][i], buf, sizeof(buf), &context) & 1 != 1) { - /* + /* * Wrong file ? * forward it to gzip */ @@ -46,14 +47,14 @@ vms_expand_args(old_argc, argv) vms_argv[new_argc++] = argv[0][i]; } } else { - p = (char*)xmalloc(strlen(buf)+1); + p = xmalloc(strlen(buf)+1); strcpy(p, buf); if (new_argc < max_files) { vms_argv[new_argc++] = p; } - while (find_file_c(argv[0][i], buf, + while (find_file_c(argv[0][i], buf, sizeof(buf), &context) & 1 == 1) { - p = (char*)xmalloc(strlen(buf)+1); + p = xmalloc(strlen(buf)+1); strcpy(p, buf); if (new_argc < max_files) { vms_argv[new_argc++] = p; @@ -83,13 +84,13 @@ int find_file_c(in,out,out_len,context) struct Str_desc in_desc,out_desc; int status; char *p; - + in_desc.addr = in; in_desc.length = strlen(in); - + out_desc.addr = out; out_desc.length = out_len; - + status = lib$find_file(&in_desc,&out_desc,context); p = out_desc.addr; @@ -97,6 +98,6 @@ int find_file_c(in,out,out_len,context) p++; } *p = 0; - + return status; }