Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: base/android/linker/crazy_linker/src/crazy_linker_error.cpp

Issue 23717023: Android: Add chrome-specific dynamic linker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename library Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #include "crazy_linker_error.h"
6
7 #include <stdarg.h>
8 #include <string.h>
9 #include <stdio.h>
10
11 #include "crazy_linker_debug.h"
12
13 namespace crazy {
14
15 void Error::Set(const char* message) {
16 if (!message)
17 message = "";
18 strlcpy(buff_, message, sizeof(buff_));
19
20 LOG("--- ERROR: %s\n", buff_);
21 }
22
23 void Error::Append(const char* message) {
24 if (!message)
25 return;
26 strlcat(buff_, message, sizeof(buff_));
27
28 LOG("--- ERROR: %s\n", buff_);
29 }
30
31 void Error::Format(const char* fmt, ...) {
32 va_list args;
33 va_start(args, fmt);
34 vsnprintf(buff_, sizeof(buff_), fmt, args);
35 va_end(args);
36
37 LOG("--- ERROR: %s\n", buff_);
38 }
39
40 void Error::AppendFormat(const char* fmt, ...) {
41 va_list args;
42 va_start(args, fmt);
43 size_t buff_len = strlen(buff_);
44 vsnprintf(buff_ + buff_len, sizeof(buff_) - buff_len, fmt, args);
45 va_end(args);
46
47 LOG("--- ERROR: %s\n", buff_);
48 }
49
50 } // namespace crazy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698