int Pad(char *pszString, int iLength)
{int iLen = strlen(pszString);
if (iLength <= iLen) {
return(iLen);
} /* endif */
/********************************************************************/
/* Start at the end of the string and add blanks. */
/********************************************************************/
while (iLen < iLength) {
pszString[iLen]='';
iLen++;
} /* endwhile */
/********************************************************************/
/* Add the null terminator to make it a 'C' string. */
/********************************************************************/
Figure 302. Sample WSG Server Logon Exit Program (Part 47 of 50)
pszString[iLen] = 0x00;
iLen = strlen(pszString);
return(iLen);
}
/* Function Specification *********************************************/
/* */
/* Function Name: Trim */
/* */
/* char *pszString - null terminated string, may have trailing */
/* blanks */
/* */
/* int iLength - start position of the string to be trimmed. This */
/* need not be the length of the string. If you are */
/* trimming a 'C' string, specify the position of any */
/* NULL terminator. */
/* */
/* iLength should be where you want the NULL term. */
/* */
/* Thus, iLength=10 means array position 10, not 9. */
/* */
/* Descriptive Name: pads a string with blanks */
/* */
/* End Function Specification *****************************************/
Figure 302. Sample WSG Server Logon Exit Program (Part 48 of 50)
AppendixE. TCP/IP Application Exit Points and Programs 593