stripping newline from input

From: John Smith (soneone_at_microsoft.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 12:48:23 +0100

Hi all

Why doesn't this seem to work?

void stripnl(char *sz)
{
  char *nl;
  nl = strchr(sz, '\n');
  if (nl)
  {
    *nl = '\0';
  }
}

The string fed in still has the newline after calling this function.

Thanks
John