home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / os2 / programm / 6512 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.8 KB

  1. Path: sparky!uunet!know!cass.ma02.bull.com!mips2!news.bbn.com!seismo!darwin.sura.net!gatech!rutgers!cmcl2!panix!os2man
  2. From: os2man@panix.com (Larry Salomon Jr.)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: sprintf() hangs application (*more info*)
  5. Message-ID: <1992Nov17.200854.18963@panix.com>
  6. Date: 17 Nov 92 20:08:54 GMT
  7. References: <1992Nov17.190901.16350@panix.com>
  8. Organization: PANIX Public Access Unix, NYC
  9. Lines: 35
  10.  
  11. In <1992Nov17.190901.16350@panix.com> I write:
  12.  
  13. >For some reason, a call to sprintf() instead one of my routines
  14. >(called getTempName()) hangs my PM application (using C-Set/2 from
  15. >CD ROM to compile).
  16.  
  17. >Since sprintf() calls malloc() I decided to allocate 100 bytes before
  18. >calling sprintf() (and immediately free the 100 bytes), and - sure enough -
  19. >the app hung on the malloc() call.
  20.  
  21. >It sounds like something is getting trashed somewhere, but I don't make
  22. >any calls to malloc() (I use my own home-grown routines, which I am 99%
  23. >sure are correct) so it's not like the run-time is suffering from memory
  24. >fragmentation.
  25.  
  26. Since then, I've changed the call to getTempName() to
  27. sprintf(achFile,"MSR%05d",0) and then to sprintf(achFile,"MSR%5d",0) and
  28. then to sprintf(achFile,"MSR00000") and finally to strcpy(achFile,"MSR00000").
  29.  
  30. The first three changes resulted in IPMD reporting an access violation, while
  31. the last call simply hung the app again.  I'm having trouble opening an
  32. annotated listing in IPMD so I can't verify the code that is being generated.
  33.  
  34. My compiler options are:
  35.  
  36. -C+ -Gd- -Ge+ -Gm+ -Ms -O- -Re -S2 -Sa -Se -Sp -Ss+ -W3
  37.  
  38. If *anyone* has any ideas, *please* let me know ASAP!
  39.  
  40. Cheers,
  41. Q
  42. -- 
  43. "If you choose not to decide, you  | "A fool and his money are fun to go
  44.  still have made a choice" - Rush  |  out with" - seen on a T-shirt
  45. ------------------------------------------------------------------------
  46.