TIP: Click on subject to list as thread! ANSI
echo: muffin
to: Bo Simonsen
from: mark lewis
date: 2010-03-14 09:40:40
subject: Funny code section

ML>Was trying to modify phone number validation and saw this:
ML>
ML>  /* Asshole detector */
ML>  if (stristr(szNewPhone, "555-1212") ||
stristr(szNewPhone, "5551212"))
ML>  {
ML>    Puts(cantskip);
ML>    return TRUE;
ML>  }

 BS> Heh I guess it should match all 555- ;)

no, it shouldn't... one should know how the phone numbers are assigned and
for what purposes... especially when coding POTS capable software...
consider a system that uses a call-back verifier? if someone is being, as
the code says, an asshole, and they put a 555-1212 number in, it will call
the information operator... however, 555-0100 thru 555-0199 are guaranteed
by the telcos to not connect anywhere... these are for fictional use like
in movies and tv shows... you'd be surprised at how many folk think they
can call numbers used in movies and tv shows... you're be more surprised at
how many folk actually do dial them ;)

 BS> Reading other peoples code can be very entertaining.. 

i can definitely agree with that :)

)\/(ark

* Origin: (1:3634/12)
SEEN-BY: 3/0 10/1 11/200 201 203 331 14/400 34/999 120/228 123/500 128/2 187
SEEN-BY: 140/1 222/2 226/0 236/150 249/303 250/1 306 261/20 38 100 1404 1406
SEEN-BY: 261/1418 266/1413 280/1027 320/119 393/11 396/45 633/104 260 267
SEEN-BY: 640/954 690/682 734 712/0 313 848 800/432 801/161 189 2222/700
SEEN-BY: 2320/100 5030/1256
@PATH: 3634/12 123/500 261/38 633/260 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.