Posts

Showing posts with the label bugs

worries with the main logic of endswith !

reference : http://satisheerpini.blogspot.com/2008/04/endswith-function-in-c.html i have been having enough problems getting the main logic of the endswith function right, .... the code for the main loop in the program which does the string matching is as follows : ____________________________________________________________________________________ for(i=0;i dir_recd_len;i++){ if(i continue ; else{ /* * the first error lay here , i forgot to give the * brackets at (85,19) and (85,45), that gave negative values * during iterations , which was disastrous */ if(argv[2][i-(dir_recd_len-comp_str_len)]==dir_recd->d_name[i]){ flag=1; } else{ flag=0; /* * could not use exit(0) or bre...