~mingw-w64/mingw-w64/experimental

« back to all changes in this revision

Viewing changes to ironcrate/string/strrev.c

  • Committer: ktietz70
  • Date: 2009-12-07 19:49:25 UTC
  • Revision ID: svn-v4:4407c894-4637-0410-b4f5-ada5f102cad1:experimental:1611
Rename to iCrt (ironCrate)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <w64crt.h>
 
2
#include <w64string.h>
 
3
 
 
4
char *
 
5
strrev (char *d)
 
6
{
 
7
  size_t dl = strlen (d);
 
8
  char *l, *r;
 
9
 
 
10
  if (!dl)
 
11
    return d;
 
12
  l = d;
 
13
  r = d + dl -1;
 
14
  while (l < r)
 
15
    {
 
16
      l[0]^=r[0]^=l[0]^=r[0];
 
17
      l++, --r;
 
18
    }
 
19
  return d;
 
20
}
 
21