Wolfgang Denk wrote: > Dear Jean-Christophe PLAGNIOL-VILLARD, > > In message <[email protected]> you wrote: >>> 705 /* Terminate fs_type string. Writing past the end of vistart >>> 706 is ok - it's just the buffer. */ >>> 707 vistart->fs_type[8] = '\0'; >> why not do something like this >> >> *(vistart + sizeof(volume_info)) = '\0'; > > Because that would be terribly wrong - sizeof(volume_info) is > 23 > (probably 24), and vistart is a pointer volume_info, so you would > probably write some 500+ bytes beyond the end of the buffer.
How about something in the same vein then char *c = vistart->fstype; c[8] = '\0'; Cheers, Dave _______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

