This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] remote debugging patches


Michal Ludvig <mludvig@suse.cz> writes:

|> Andreas Schwab wrote:
|> > Why are you truncating the name to 100 characters?
|> 
|> It is just an informational message and 100 chars shoud be enough almost
|> everytime.
|> 1) IPv4 (or IPv6 sometime in the future) address can't be as long.
|> 2) I didn't expect to have a resolved domainname such long.
|> 3) Neither serial port names are so long.
|> 4) I take care about buffer-overruns using snprintf.

Maybe it's just me, but I hate arbitrary limits.  There is no need for
sprintf at this point anyway.  I'd suggest to define another variable that
either points to name or to the result of inet_ntoa and use that in the
fprintf call.  No need for namebuf either.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]