[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

C Programming warning



I hope I'm not posting to the wrong place, if so, please remind me :)
I'm making some practice on C programming, so that I can get into the
linux world. Here is a simple code

129     char comment[1025];
130     cgiFormString("comment", comment, 1025);
131     if(strcasestr(comment, "</xmp")!=NULL)
       {
               fprintf(cgiOut, "</xmp is not allowed");
               return;
       }

when i compile, there is a warning:
 gcc -o LeaveMessage LeaveMessage.c cgic.c
LeaveMessage.c: In function 'LeaveMessage':
LeaveMessage.c:131: warning: comparison between pointer and integer

but i found in http://www.gnu.org/software/libc/manual/html_node/Search-Functions.html#Search-Functions
— Function: char * strcasestr (const char *haystack, const char *needle)

So i don't know why i got this warning, what's the correct way to deal with it?

thanks!
--
Regards!
Star
Shanghai, China



-- 
Regards!
Star
Shanghai, China

Reply to: