Re: Defacto standard string library



On Jan 2, 3:31 pm, jameskuyper <jameskuy...@xxxxxxxxxxx> wrote:
user923005 wrote:
On Jan 2, 1:36 pm, Stephen Sprunk <step...@xxxxxxxxxx> wrote:
...
If you only concatenate one valid string to another, it's not an issue.

If that is all you need to do, then use mem* functions and not str*
functions and there will be less trouble.

But then you'll have to search for, or at least keep track of, the
location of the terminating null byte,

If we are only ever concatenating, then this piece of math is rather
trivial.

in order to tell the mem*
functions how much data to move around or compare. What advantages do
you perceive to using the mem* functions rather than the corresponding
str* functions for this purpose?

The str* functions don't work properly and the mem* functions do.

Actually, I see no advantage in using mem* functions other than
possibly not trying something that I should not be trying.

I would never use standard C library functions to localize when ICU is
available. It's utter insanity.
.



Relevant Pages

  • Re: Defacto standard string library
    ... functions and there will be less trouble. ... The str* functions don't work properly and the mem* functions do. ... ICU might be the greatest thing since sliced bread; ...
    (comp.lang.c)
  • Re: Defacto standard string library
    ... If that is all you need to do, then use mem* functions and not str* ... functions and there will be less trouble. ... str* functions for this purpose? ...
    (comp.lang.c)
  • [PATCH 1/6] UML - Fix missing KBUILD_BASENAME
    ... get a definition with the by-hand compilation in the main UML Makefile. ... +#define OFFSET(sym, str, mem) \ ...
    (Linux-Kernel)
  • Re: Defacto standard string library
    ... Please give me an example of a situation where you have null terminated strings, ... There is a mem* function that can be used to do what needs to be done (this is NOT the case for most of the str* functions). ... The corresponding str* function does not work correctly when dealing with a UTF-8 string. ...
    (comp.lang.c)
  • Re: strdup()
    ... malloc failures anyway? ... return mem; ... char *xstrdup(const char *str) ...
    (comp.lang.c)