Re: memcpy/memmove

From: Christopher Benson-Manica (ataru_at_nospam.cyberspace.org)
Date: 11/12/03


Date: Wed, 12 Nov 2003 15:27:16 +0000 (UTC)

Simon Biber <news@ralminnospam.cc> spoke thus:

> All six have undefined behaviour: both pointers must be valid
> pointers even if the number of characters to copy is zero.

> C99 7.21.1#2 (trimmed)

Thank you. Now, if only K&R2, my other C book, or my friendly man page had
said as much...

-- 
Christopher Benson-Manica  | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org    | don't, I need to know.  Flames welcome.


Relevant Pages

  • Re: strncmp(a,b,0)
    ... >> Now I have it to return zero. ... > characters (characters that follow a null character are not ... > reads it would seem that signed chars would be allowed to affect ... the pointers need to be cast ...
    (comp.lang.c)
  • Re: memcpy/memmove
    ... >> pointers even if the number of characters to copy is zero. ... want to buy a copy of the C99 Standard, ...
    (comp.lang.c)
  • Re: memcpy/memmove
    ... One byte is copied from src to dest. ... Defined behaviour: no characters are copied. ... both pointers must be valid ... pointers even if the number of characters to copy is zero. ...
    (comp.lang.c)
  • Re: How to destroy Leopard/Vista/Dragon, all at one fell swoop
    ... I prefer to use words to get across meaning, as in "hex zero", which is ... winded technical explanation about characters, bytes, numbers, ... Try explaining "hex notation" to an unknowledgeable reader, ...
    (comp.sys.mac.system)
  • Re: NULL and zeros
    ... 8-bits bytes and ASCII. ... characters; that's what character constants are for. ... not to have to initialize all pointers inside. ... Pointers are initialized to null even if null is ...
    (comp.lang.c)