25.05.2013, 22:57
pra q serve isso, e quando usar?
pawn Код:
#define MAX_INI_ENTRY_TEXT 80
stock DB_Escape(text[])
{
new
ret[MAX_INI_ENTRY_TEXT * 2],
ch,
i,
j;
while ((ch = text[i++]) && j < sizeof (ret))
{
if (ch == '\'')
{
if (j < sizeof (ret) - 2)
{
ret[j++] = '\'';
ret[j++] = '\'';
}
}
else if (j < sizeof (ret))
{
ret[j++] = ch;
}
else
{
j++;
}
}
ret[sizeof (ret) - 1] = '\0';
return ret;
}