On Wednesday 14 June 2006 14:01, Jimmy Huang wrote:
> As is turns out, Trent is right, and gcc isn't too
> smart.

This isn't gcc's fault.
Your char array isn't a valid string so expecting tools like str* and 
printf %s to work is foolish.

Arguably GCC should warn you about it but it doesn't.

> I assume the correct way would be:
>
> printf ("%c%c \n",mapchar[0],mapchar[1]);

Yep.
Or
printf ("%.2s \n",mapchar);

man 3 printf is your friend :)

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mailman.us.netrek.org/pipermail/netrek-dev/attachments/20060614/9fd17044/attachment.pgp