tftp: fix type of block arg to store_block
PATCH 1/1 tftp: fix type of block arg to store_block
In reply to a message not in the archiveDear "Jayachandran C",
Quoted 3 lines · In message <1338961566-13389-1-git-send-email-jayachandranc@netlogicmicro.com>…
The block argument for
store_blockcan be -1 when the tftp sequence number rolls over (i.e TftpBlock == 0), so the first argument tostore_blockhas to be of type 'int' instead of 'unsigned'.
What makes you think so?
Review
Quoted 4 lines
(quoted diff) +1
-1-store_block (unsigned block, uchar * src, unsigned len) +store_block (int block, uchar * src, unsigned len) { ulong offset = block * TftpBlkSize + TftpBlockWrapOffset;
Block gets used to compute the offset into the storage area, so it must never be negative.
I think your analysis must be flawed.
Best regards,
Wolfgang Denk
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Making files is easy under the UNIX operating system. Therefore, users tend to create numerous files using large amounts of file space. It has been said that the only standard thing about all UNIX systems is the message-of-the-day telling users to clean up their files. - System V.2 administrator's guide