Skip to content
Snippets Groups Projects
Commit 28c97a8c authored by rswindell's avatar rswindell
Browse files

Created lastchar() utility function (returns last character in string).

parent 7aa4720f
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,20 @@ ...@@ -55,6 +55,20 @@
#include "genwrap.h" /* Verify prototypes */ #include "genwrap.h" /* Verify prototypes */
/****************************************************************************/
/* Return last character of string */
/****************************************************************************/
char DLLCALL lastchar(const char* str)
{
size_t len;
len = strlen(str);
if(len)
return(str[len-1]);
return(0);
}
/****************************************************************************/ /****************************************************************************/
/* Convert ASCIIZ string to upper case */ /* Convert ASCIIZ string to upper case */
/****************************************************************************/ /****************************************************************************/
......
...@@ -123,6 +123,8 @@ extern "C" { ...@@ -123,6 +123,8 @@ extern "C" {
#endif #endif
#endif #endif
DLLEXPORT char DLLCALL lastchar(const char* str);
/****************************/ /****************************/
/* Common Utility Functions */ /* Common Utility Functions */
/****************************/ /****************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment