1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
9 extern "C" char* Reverse(const char* s
) {
10 size_t len
= strlen(s
);
11 char* reversed
= static_cast<char*>(malloc(len
+ 1));
12 for (int i
= len
- 1; i
>= 0; --i
)
13 reversed
[len
- i
- 1] = s
[i
];