home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso / altsrc / articles / 11177 < prev    next >
Text File  |  1994-08-26  |  1KB  |  30 lines

  1. Path: wupost!psuvax1!rutgers!att-out!pacbell.com!decwrl!pa.dec.com!jrd.dec.com!diamond
  2. From: diamond@jrd.dec.com (Norman Diamond)
  3. Newsgroups: comp.editors,alt.sources,comp.misc,comp.unix.misc,comp.mail.misc,comp.unix.admin
  4. Subject: Re: JOE 1.0.12 - Blurb
  5. Date: 26 Aug 1994 10:25:05 GMT
  6. Organization: Digital Equipment Corporation Japan , Tokyo
  7. Lines: 15
  8. Distribution: inet
  9. Message-ID: <33kfu1$eff@usenet.pa.dec.com>
  10. References: <Cur3x5.A95@world.std.com> <Cv0B4q.EDu@world.std.com> <Cv1o5M.2GC@world.std.com> <Cv4GDy.GMr@world.std.com>
  11. Reply-To: diamond@jrd.dec.com (Norman Diamond)
  12. NNTP-Posting-Host: jit533.jrd.dec.com
  13. Xref: wupost comp.editors:12794 alt.sources:11177 comp.misc:21583 comp.unix.misc:16436 comp.mail.misc:17592 comp.unix.admin:26827
  14.  
  15. In article <Cv4GDy.GMr@world.std.com> jhallen@world.std.com (Joseph H Allen) writes:
  16. >unsigned short a=1024;
  17. >unsigned short b=1024;
  18. >int c=311;
  19. >char *d="Hello there";
  20. >main() { printf("%x %x\n",d+c,d+a-(b-c)); }
  21.  
  22. >The fix for JOE is to change the two 'unsigned short's in the file b.h to
  23. >'int's.  This is truly a bizzare problem.
  24.  
  25. The correct fix is to change the two '%x' conversions to '%hx' conversions.
  26. %x requires an unsigned int argument; %hx requires an unsigned short argument.
  27. --
  28.  <<  If this were the company's opinion, I would not be allowed to post it.  >>
  29. segmentation fault (california dumped)
  30.