Article View: comp.windows.interviews
Article #1446Interviews bugs wating to happen!
From: Dan Connolly
Date: Fri, 07 Jun 1991 01:15
Date: Fri, 07 Jun 1991 01:15
22 lines
1390 bytes
1390 bytes
I posted to complain about error checking in the doc app, with hopes that
the library code would be better, but I just found this:
char metrics_path[100];
sprintf(metrics_path, "%s/%s.afm", ps_metrics_dir, psname);
If you ask me, this is just a bug waiting to happen. There are these arbitrary
constants for the length of strings all over the place! There's no excuse
when C++ makes it so easy to:
char metrics_path = new char[srtlen(ps_metrics_dir) + 1 +
strlen(psname) + sizeof(".afm") + 1];
sprintf(metrics_path, "%s/%s.afm", ps_metrics_dir, psname);
And all the parsing with sscanf is driving me nuts! First of all, there
are differences between sun's sscanf and our (ANSI, POSIX) sscanf, especially
in what they return. (Matcheditor::HandleChar is a prime example).
I can't imagine nobody's been bitten by these undocumented assumptions
all over the code.
Dan
Technical Details
Message-ID:
<1991Jun07.011552.16316@convex.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!convex!connollyShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!convex!connolly From: connolly@convex.com (Dan Connolly) Subject: Interviews bugs wating to happen! Message-ID: <1991Jun07.011552.16316@convex.com> Sender: usenet@convex.com (news access account) Nntp-Posting-Host: imagine.convex.com Organization: CONVEX Computer Corporation, Richardson, Tx., USA Date: Fri, 07 Jun 1991 01:15:52 GMT Lines: 23