mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
Fixes to strchr, mkfats, and NxWidgets from Petteri Aimonen
This commit is contained in:
@@ -4581,3 +4581,8 @@
|
|||||||
variables with auto-generated documentation. The initial checkin
|
variables with auto-generated documentation. The initial checkin
|
||||||
is an incomplete, poorly structured prototype that I hope to
|
is an incomplete, poorly structured prototype that I hope to
|
||||||
evolve into a useful tool (2014-4-20).
|
evolve into a useful tool (2014-4-20).
|
||||||
|
* libc/string/lib_strchr.c: strchr(str, '\0') should return a
|
||||||
|
pointer to the end of the string, not NULL. From Petteri
|
||||||
|
Aimonen (2014-4-22).
|
||||||
|
* fs/fat/fs_writefat.c: mkfatfs was writing the boot code to the
|
||||||
|
wrong location. From Petteri Aimonen (2014-4-22).
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ static inline void mkfatfs_initmbr(FAR struct fat_format_s *fmt,
|
|||||||
|
|
||||||
/* Boot code may be placed in the remainder of the sector */
|
/* Boot code may be placed in the remainder of the sector */
|
||||||
|
|
||||||
memcpy(&var->fv_sect[BS16_BOOTCODE], var->fv_bootcode, var->fv_bootcodesize);
|
memcpy(&var->fv_sect[BS32_BOOTCODE], var->fv_bootcode, var->fv_bootcodesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The magic bytes at the end of the MBR are common to FAT12/16/32 */
|
/* The magic bytes at the end of the MBR are common to FAT12/16/32 */
|
||||||
|
|||||||
@@ -64,12 +64,17 @@ FAR char *strchr(FAR const char *s, int c)
|
|||||||
{
|
{
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
for (; *s; s++)
|
for (; ; s++)
|
||||||
{
|
{
|
||||||
if (*s == c)
|
if (*s == c)
|
||||||
{
|
{
|
||||||
return (FAR char *)s;
|
return (FAR char *)s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!*s)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user