OpenCores
URL https://opencores.org/ocsvn/thor/thor/trunk

Subversion Repositories thor

[/] [thor/] [trunk/] [FT64v5/] [software/] [CC64/] [source/] [rtrim.cpp] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 robfinch
#include "stdafx.h"
2
#include <string.h>
3
#include <ctype.h>
4
 
5
/* ---------------------------------------------------------------
6
        Description :
7
                Trims spaces from the right side of a string. Spaces
8
        are anything considered to be a space character by the
9
        isspace() function.
10
--------------------------------------------------------------- */
11
 
12
char *rtrim(char *str)
13
{
14
   int ii;
15
 
16
   ii = strlen(str);
17
   if (ii)
18
   {
19
      --ii;
20
      while(ii >= 0 && isspace(str[ii])) --ii;
21
      ii++;
22
      str[ii] = '\0';
23
   }
24
   return str;
25
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.