Re: kdp_match_name
Re: kdp_match_name
- Subject: Re: kdp_match_name
- From: Stephen Checkoway <email@hidden>
- Date: Thu, 17 Sep 2015 22:48:27 -0500
> On Sep 17, 2015, at 5:23 PM, Stan Sieler <email@hidden> wrote:
>
> I’m asking partially to learn if my understanding of when to use
> strncmp is wrong or not.
strncmp and strncpy are for working with fixed-width fields which may not be NUL-terminated. It's extremely rare that these functions should be used.
The code in question appears to have
char kdpname[80];
so using strncmp doesn't really matter here. My guess is that it was done because some code paths in PE_parse_boot_argn (those for arguments that aren't strings) don't NUL-terminate.
--
Stephen Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden