h=hid; while(h!=NULL) { if(memcmp(b,h->msgid,16)==0) { memcpy(c,h->id,8); } }
Spot it.
On Tue, 1 Oct 2002, Satya wrote:
h=hid; while(h!=NULL) { if(memcmp(b,h->msgid,16)==0) { memcpy(c,h->id,8); } }
well, assuming you've got b and c defined somewhere earlier, all I can say is that h isn't changing anywhere, so if it wasn't null at the start, it never will be null.
then again, there could be more to your code happening later in the while loop (which isn't terminated so far).
I really think we'd need to see more of the code.
Philip
On Oct 3, 2002 at 10:18, Philip S Tellis wrote:
On Tue, 1 Oct 2002, Satya wrote:
h=hid; while(h!=NULL) { if(memcmp(b,h->msgid,16)==0) { memcpy(c,h->id,8); } }
well, assuming you've got b and c defined somewhere earlier, all I can
Yeah, they are, I should've ssaid that earlier. b is passed, c is malloced.
say is that h isn't changing anywhere, so if it wasn't null at the start, it never will be null.
That's what I was looking for. I'd forgotten the h=h->next;
then again, there could be more to your code happening later in the while loop (which isn't terminated so far).
Yes it is. Isn't it?
On Wed, 2 Oct 2002, Satya wrote:
On Oct 3, 2002 at 10:18, Philip S Tellis wrote:
On Tue, 1 Oct 2002, Satya wrote:
h=hid; while(h!=NULL) { if(memcmp(b,h->msgid,16)==0) { memcpy(c,h->id,8); } }
[snip]
then again, there could be more to your code happening later in the while loop (which isn't terminated so far).
Yes it is. Isn't it?
yeah, it is. your indentation threw me off.
Philip S Tellis wrote:
On Tue, 1 Oct 2002, Satya wrote:
h=hid; while(h!=NULL) { if(memcmp(b,h->msgid,16)==0) { memcpy(c,h->id,8); } }
then again, there could be more to your code happening later in the while loop (which isn't terminated so far).
[rub eyes... rub rub...] What? AFAICS the while loop *is* terminated.
And I don't see any error in the code. :-?
Manish