www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/14/09:24:43

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: DJGPP AT sun DOT soe DOT clarkson DOT edu
Date: Tue, 14 Nov 1995 14:05:35 GMT
Subject: Funny with characters > 127 in Gnu C/C++ call args

I ran this program:-

#include<stdio.h>
main(int nargs,char**Arg){int i; printf("There are %d args\n",nargs);
for(i=0;i<nargs;i++) printf("arg[%1d] = `%s'\n",i,Arg[i]);}

thus:- (NB: Where I have `\252' below, the actual input and output had the
\252 character, i.e. the `logical not' character (170, 0xaa), but my emailer
(Pegasus) always alters or removes characters > 127 in messages that I send)

C:\WORK>t$ The patrol-mini-sub scooped up the scubadivers
There are 7 args
arg[0] = `c:/work/t$.exe'
arg[1] = `The'
arg[2] = `patrol-mini-sub'
arg[3] = `scooped'
arg[4] = `up'
arg[5] = `the'
arg[6] = `scubadivers'      /* All args were sent to the program OK */

C:\WORK>t$ cat\252and\252mouse\252games    /* with chars > 127 in */
There are 2 args
arg[0] = `c:/work/t$.exe'
arg[1] = `cat'        /* and the args were truncated at the 0xaa character */

C:\WORK>\am\readscr

  This is a nuisance. Will it still happen with version 2?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019