Re: Return pointer from function
- From: "dykeinthebox" <dykeinthebox@xxxxxxxxxxxx>
- Date: Wed, 27 Jun 2007 18:13:06 +0200
Liviu <oli...@xxxxxxxxx> wrote:
Say i have afunction:
char *rmtrail(char *str)
{
if (str)
{
int i;
for (i = strlen(str) - 1; i >= 0 && isspace(str[i]); --i)
;
str[++i] = '\0';
}
returnstr;
}
This function invokes undefined behavior when called with a whitespace-only
string.
.
- Follow-Ups:
- Re: Return pointer from function
- From: Flash Gordon
- Re: Return pointer from function
- References:
- Return pointer from function
- From: Liviu
- Re: Return pointer from function
- From: Richard Bos
- Re: Return pointer from function
- From: Liviu
- Return pointer from function
- Prev by Date: Re: memcpy vs memmove
- Next by Date: Re: Return pointer from function
- Previous by thread: Re: Return pointer from function
- Next by thread: Re: Return pointer from function
- Index(es):
Relevant Pages
|
|