Example #1
0
DBInt DBMiscTrimQuotes(char *str) {
    DBInt i, quoteNum = 0, strLen = strlen(str);

    DBMiscTrimWhiteSpaces(str);
    if (((str[0] != '\"') || (str[strLen - 1] != '\"')) &&
        ((str[0] != '\'') || (str[strLen - 1] != '\'')))
        return (quoteNum);

    for (i = 0; i < strLen - 2; ++i) str[i] = str[i + 1];
    str[i] = '\0';
    return (DBMiscTrimQuotes(str) + 1);
}
Example #2
0
File: DBMath.C Project: amiara/RGIS
DBMathOperand::DBMathOperand (char *expression)

	{
	if ((Var.String = (char *) malloc (strlen (expression) + 1)) == (char *) NULL)
		{ CMmsgPrint (CMmsgSysError, "Memory allocation error in: %s %d",__FILE__,__LINE__); }
	else
		{
		strcpy (Var.String, expression);
		DBMiscTrimWhiteSpaces (Var.String);
		DBMiscTrimBrackets (Var.String);
		if ((int) strlen (Var.String) < 1) { free (Var.String); Var.String = (char *) NULL; }
		}
	}