View Single Post
  #8   Spotlight this post!  
Unread 21-03-2005, 08:12
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Printf Oddity : Programming Challange

Quote:
Originally Posted by DarkAlex
If the initialization statement, which might be stored as a static array of characters, was, for some reason, larger than the allowed buffer on the printf statement (about 42?) would that possibly cause the error? I don't think it was, but just in case. We'll probably be pit neighbors at Drexel. I'll bring a candy bar.
Printf can be a source of this kind of problem. I know with the old IFI implementation the string array was copied into a data buffer of fixed size with no limit check. If the format string was > 80 characters an overwrite occurred. This is usually easy to spot because the clobbered variables have typical ASCII values like 8224 (2 blank spaces).

Bring Skittles
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle