Metz's Law of Anal Retentive Developers: "Never validate an input field unless you *KNOW* what the rules are: assumption, belief, habit, urban legends, etc., don't count!" The world is full of people that "validate" names without having a clue about any ethnicity but their own and e-mail addresses when the can't even spell RFC. "An e-mail address is invalid if it uses characters hat I don't use in mine." or some such idiocy.
My other pet peeve for web sites is forms with long input fields and no explanation of the required syntax. Are blanks allowed, mandatory or prohibited? Ditto hyphens and slashes. Is a long ZIP code field 5 or 9? I can't think of any others off the top of my head, but I would bet that they exist. Or take client-side scripts - please! -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of Charles Mills [charl...@mcn.org] Sent: Tuesday, March 1, 2022 1:29 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: ZAD and C/C++ (was:: 2.5 Heads Up) Ah! (void *). I know what that means, but I am perhaps too dense to see what (void *)"" would accomplish. I "get" what it is doing -- casting a char* (or maybe a const char*) as a void* -- but other than for some obscure test I don't see the purpose. Certainly open(NULL, ...) is a possible real-life mistake. You write a function that expects a passed file name; I call it thinking it is "smart" enough to know that a filename of NULL means don't use a file; you try to open what I pass. Too lazy to test and see what happens. I certainly agree that "bad address" is a lot more useful than "no such file." "Address is NULL" would be even more useful, to distinguish this special case from the case of some random garbage pointer. The programmer could look for "how might I be passing NULL?" as opposed to looking for "what might have corrupted that address?" There is so much HORRIBLE error diagnosis out there. I have been wrestling the past week with the Google App Store. Would not take an e-mail address on a particular page. Error message: "E-mail address is not valid." Huh? I get e-mail there. After hours of hacking it turned out to mean "that e-mail address is not associated with any gmail address." Another situation where it was rejecting an e-mail address, this time with the error "! Try reformatting". Well, gee, it was your basic e-mail format, som...@domain.com. No blanks or anything like that. Never did figure out what they wanted; got around the problem another way. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Tuesday, March 1, 2022 9:48 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: ZAD and C/C++ (was:: 2.5 Heads Up) On Tue, 1 Mar 2022 08:46:35 -0800, Charles Mills wrote: > ..., but IBM *may* simply be following it. fopen(NULL, ...) is pretty > useless any way you slice it. > <https://secure-web.cisco.com/1aJzItmS0H9nv-yaXomvv3Q0sTqMdjNY8S9FJLyhlMJPFtj1sFpPM2S6ZEWm26Z_AwjvPZ3CHL6kbMFGytKw_Stj7fgtpgVVt7JIVOlERyCwJi7ZU3esNmAqPwFI-xK3L0A5MlbKD_MRhbnj5ZP5J8atEcaRka8q0poYofY_ZE59fMzkCmsLh4tHCTJYtqFlxiEE_b2rFAi-R5LAYYQB6LwDh6NoMrXHVrJswXDapPSiQnkLgcp7c33apV-NIzOC9KEylwlSjavUoSsqFnsw-V--zKnId43bCM12i6EyJiPcrrdnfK6Bs1v9g-IMjnUGsumhoMPhhA_0spAUhKvmZrLDk_acznz5mL4FVPyodaAaDUiJsnxhDI2lYMDiZg03JKX-XYVz2PjJMchWEu1OYSD3l5KEx3B2TezBwokwe1CcROK9Gx8jEMIH-i7tdbdFj/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FFuzzing> On Mac OS: printf ("%d\n", open( "", 0 ) ); -1 No such file or directory printf ("%d\n", open( NULL, 0 ) ); -1 Bad address I think both are optimal. OpenGroup doesn't specify the latter/ >I have no idea what (void I)"" would > Typo for (void *). Short finger? -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN