[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Kill strcpy and strcat
From: |
Pawel Kot |
Subject: |
Re: [PATCH] Kill strcpy and strcat |
Date: |
Wed, 7 Nov 2007 16:16:55 +0100 |
Hi,
(anwering to myself)
On Nov 7, 2007 2:26 PM, Pawel Kot <address@hidden> wrote:
> Maybe somebody could tell me if there is a difference between:
> snprintf(buf, sizeof(buf), "%s", some_string);
> and
> strncpy(buf, some_string, sizeof(buf));
> buf[sizeof(buf) - 1] = 0;
If some_string is NULL, then strncpy will segfault.
I'd suggest using snprintf() in gnokii documentation. Any objections?
take care,
pkot
--
Pawel Kot
- Re: [PATCH] Kill strcpy and strcat, (continued)
- Re: [PATCH] Kill strcpy and strcat, Daniele Forsi, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Pawel Kot, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Bastien Nocera, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Pawel Kot, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Bastien Nocera, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Pawel Kot, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Philip Kendall, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Pawel Kot, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Ian Collier, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat, Pawel Kot, 2007/11/07
- Re: [PATCH] Kill strcpy and strcat,
Pawel Kot <=