Re: cvs commit: src/sbin/route route.c

看板DFBSD_commit作者時間21年前 (2005/03/16 13:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/10 (看更多)
On Wed, 16 Mar 2005 05:56:34 +0100 Joerg Sonnenberger <joerg@britannica.bec.de> wrote: > On Tue, Mar 15, 2005 at 08:47:01PM -0800, Chris Pressey wrote: > > > > - start at sa_data, end at sa + sa_len (NOT sa_data + sa_len); > > - don't make assumptions about the size of u_short. > > Actually this code this makes assumptions :) Would uint16_t be preferable here? > I think it should be: > splim = (u_short *)sa + > (sa->sa_len - offsetof(sa->sa_data)) / sizeof(u_short); I think that should be splim = (u_short *)sa->sa_data + (sa->sa_len - offsetof(sa->sa_data)) / sizeof(u_short); but that'd be the same as the thing I committed, just longer. > Beside, find a better way to do the hex printing, this is not > endian neutral. Would using htons be sufficient? -Chris
文章代碼(AID): #12DyJU00 (DFBSD_commit)
討論串 (同標題文章)
文章代碼(AID): #12DyJU00 (DFBSD_commit)