[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGSEGV, Segmentation fault.
From: |
Igor Homyakov |
Subject: |
Re: SIGSEGV, Segmentation fault. |
Date: |
Fri, 23 May 2003 16:27:14 +0400 |
User-agent: |
Mutt/1.4.1i |
* Martin Pala <martin.pala @ iol . cz> [030523 04:28]:
> You are rigth. It truncates the string to "size" - last character is
> always '\0' (even if the string was longer then dst - test attached).
>
> There is only one advantage when using "size+1" long dst - in special
> case where src is equal to dst, it won't truncate it, which is probably
> better.
from snprintf(3) OpenBSD:
http://www.openbsd.org/cgi-bin/man.cgi?query=snprintf
<cite>
Be sure to use the proper secure idiom:
snprintf(buffer, sizeof(buffer), "%s", string);
</cite>
--
Igor Homyakov
<homyakov AT ramax.spb.ru>
- SIGSEGV, Segmentation fault., Igor Homyakov, 2003/05/20
- Re: SIGSEGV, Segmentation fault., Martin, 2003/05/20
- Re: SIGSEGV, Segmentation fault., Martin Pala, 2003/05/20
- RE: SIGSEGV, Segmentation fault., Jan-Henrik Haukeland, 2003/05/20
- Re: SIGSEGV, Segmentation fault., Igor Homyakov, 2003/05/21
- Re: SIGSEGV, Segmentation fault., Igor Homyakov, 2003/05/21
- RE: SIGSEGV, Segmentation fault., Jan-Henrik Haukeland, 2003/05/21
- Re: SIGSEGV, Segmentation fault., Martin Pala, 2003/05/22
- Re: SIGSEGV, Segmentation fault.,
Igor Homyakov <=
- Re: SIGSEGV, Segmentation fault., Igor Homyakov, 2003/05/21
- RE: SIGSEGV, Segmentation fault., Jan-Henrik Haukeland, 2003/05/21
- Re: SIGSEGV, Segmentation fault., Igor Homyakov, 2003/05/22
- Re: SIGSEGV, Segmentation fault., Jan-Henrik Haukeland, 2003/05/23
- Re: SIGSEGV, Segmentation fault., Jan-Henrik Haukeland, 2003/05/31
- Re: SIGSEGV, Segmentation fault., Martin Pala, 2003/05/31