|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH v2 1/2] lib/nolibc: Add strcmp function
Reviewed-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
Costin Lupu <costin.lupu@xxxxxxxxx> writes:
> Shamelessly taken from Mini-OS.
>
> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
> ---
> lib/nolibc/string.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/lib/nolibc/string.c b/lib/nolibc/string.c
> index 018d346..bf89106 100644
> --- a/lib/nolibc/string.c
> +++ b/lib/nolibc/string.c
> @@ -156,3 +156,13 @@ int strncmp(const char *str1, const char *str2, size_t
> len)
> }
> return 0;
> }
> +
> +int strcmp(const char *str1, const char *str2)
> +{
> + register signed char __res;
> +
> + while ((__res = *str1 - *str2++) == 0 && *str1++)
> + ;
> +
> + return __res;
> +}
> --
> 2.11.0
>
--
Yuri Volchkov
Software Specialist
NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |