Skip to content

Commit

Permalink
minor clean the code
Browse files Browse the repository at this point in the history
  • Loading branch information
yhfudev committed Jan 19, 2015
1 parent 07fdedf commit 0d2c3f3
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/ucdapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ int ucd_end (ucd_t * det)
if (*det) {
reinterpret_cast<DllDetector *>(*det)->DataEnd();
return UCD_RESULT_OK;
} else {
return UCD_RESULT_INVALID_DETECTOR;
}
return UCD_RESULT_INVALID_DETECTOR;
}


Expand All @@ -130,9 +129,8 @@ int ucd_reset(ucd_t * det)
if (*det) {
reinterpret_cast<DllDetector *>(*det)->Reset();
return UCD_RESULT_OK;
} else {
return UCD_RESULT_INVALID_DETECTOR;
}
return UCD_RESULT_INVALID_DETECTOR;
}

UCD_IMEXPORT
Expand All @@ -150,20 +148,16 @@ int ucd_results (ucd_t * det, char* namebuf, size_t buflen)
//*namebuf = 0;
strcpy (namebuf, CSTR_DEFAULT);
return UCD_RESULT_OK;
} else {
return UCD_RESULT_NOMEMORY;
}
} else {
// encoding detected
if (buflen >= strlen(name)+1) {
strcpy(namebuf, name);
return UCD_RESULT_OK;
} else {
return UCD_RESULT_NOMEMORY;
}
return UCD_RESULT_NOMEMORY;
}
} else {
return UCD_RESULT_INVALID_DETECTOR;
// encoding detected
if (buflen >= strlen(name)+1) {
strcpy(namebuf, name);
return UCD_RESULT_OK;
}
return UCD_RESULT_NOMEMORY;
}
return UCD_RESULT_INVALID_DETECTOR;
}

0 comments on commit 0d2c3f3

Please sign in to comment.