Hi Spencer,

On 4/26/2019 3:54 PM, Spencer Elliott wrote:
I have examined the input (argv[n]) field in my program and it appears that 2 integers preceded the data.
[SNIP]
PARM KWD(MONPATH) TYPE(*CHAR) LEN(128) MIN(1) ALWUNPRT(*NO) +
ALWVAR(*YES) VARY(*YES *INT4)


I did not have the problem you describe...  I only had one integer, the one that contains the parameter length.  Here's the ILE C program I used to test:


#include <stdio.h>
#include <string.h>

int main(int argc, char **argv) {

   typedef struct varchar128_t {
      int len;
      char value[128];
   } varchar128;

   char buf[129];

   varchar128 *monpath = (varchar128 *)argv[1];
   printf("monpath->len = %d\n", monpath->len);

   memset(buf, '\0', sizeof(buf));
   memcpy(buf, monpath->value, monpath->len);
   printf("monpath->value = %s\n", buf);

   return 0;
}


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].