Skip to content

Commit

Permalink
Fixed hardcoded '/' characters
Browse files Browse the repository at this point in the history
  • Loading branch information
David20321 committed May 24, 2012
1 parent 4a5459e commit 05ce5a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions casecorrectpath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int CountCharsInString(const char* str, char the_char){
int count = 0;
int str_length = strlen(str);
for(int i=0; i<str_length; ++i){
if(str[i] == '/'){
if(str[i] == the_char){
++count;
}
}
Expand All @@ -28,7 +28,7 @@ int FindNthCharFromBack(const char* str, char the_char, int n){
int count = 0;
int str_length = strlen(str);
for(int i= str_length-1; i>=0; --i){
if(str[i] == '/'){
if(str[i] == the_char){
++count;
if(count == n){
return i;
Expand Down

0 comments on commit 05ce5a0

Please sign in to comment.