PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 27, 2020 2:26 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Tue Jul 11, 2006 11:24 pm 
Offline
DevNet Resident
User avatar

Joined: Sat Jun 01, 2002 10:16 am
Posts: 1136
Location: San Diego CA
Just don't use an unsigned integer (in C/C++ at least) and then put -5 into it. Semi funny story coming.

Back in the good ole DOS days I had a program that had a small bug in it. It caused the screen to go blank from time to time for about five seconds. Worked fine, but caused the blank screen. DOS text screen.

No step-through debuggers those days, and could not find the bug. Months and months of debugging. Five programmers. Program worked fine, perfect results, just this blank screen every once in a while.

Okay, cut to the chase. Was telling the program to print a certain number of spaces, said number contained in a variable which was (you guessed it) an unsigned integer. Did not have value checking on the value going into that variable and a -5 was sometimes being put in.

It takes a DOS screen five seconds to print 4294967290 spaces, which is how an unsigned int interprets -5.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group