[syslinux] IP details in COM32 module

Luciano Rocha strange at nsk.no-ip.org
Mon Jun 11 03:40:14 PDT 2007


On Mon, Jun 11, 2007 at 06:10:02PM +0800, Coe, Colin C. (Unix Engineer) wrote:
> buff is defined as 'char *buff'.
> 
> Many thanks for the pointer, the code no longer produces a hard hang.
> 
> I found a few other problems with my code as well.  Things seem to work better when defined as 'char something[n]' rather than 'char *something' but I'm not sure why this would be the case.

Yes, things usually go better when you define memory for them.
char something[n] defines an array of size n (the compiler allocates the
buffer, usually on the stack). char *something defines a pointer to an
area of memory. Unless you initialize it (like something = malloc(n) or
something = some_array), it points to a random area of memory, and
you're likely to corrupt data.

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20070611/8c20d85a/attachment.sig>


More information about the Syslinux mailing list