/* utils.c: 
 *
 ****************************************************************
 * Copyright (C) 2002, 2003 Tom Lord
 * 
 * See the file "COPYING" for further information about
 * the copyright and warranty status of this work.
 */


#include "ftp-utils/with-ftp/utils.h"



long
trim_crnl (t_uchar * str, long len)
{
  if (!len)
    return 0;

  if (str[len - 1] == '\n')
    {
      str[len - 1] = 0;
      --len;
    }

  if (!len)
    return 0;

  if (str[len - 1] == '\r')
    {
      str[len - 1] = 0;
      --len;
    }

  return len;
}




/* tag: Tom Lord Sat Jan 18 15:40:27 2003 (utils.c)
 */
