Chromium Code Reviews

Unified Diff: webrtc/examples/peerconnection/client/defaults.cc

Issue 1504283004: Enable cpplint for webrtc/examples and fix all uncovered cpplint errors. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Add "henrike" to TODO markers Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « webrtc/examples/peerconnection/client/defaults.h ('k') | webrtc/examples/peerconnection/client/flagdefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/peerconnection/client/defaults.cc
diff --git a/webrtc/examples/peerconnection/client/defaults.cc b/webrtc/examples/peerconnection/client/defaults.cc
index f70aa72e3da5b4aa5814078d5a7e05631356a547..a2501c718f62b0a4642a9e3c594a03db2a46d12d 100644
--- a/webrtc/examples/peerconnection/client/defaults.cc
+++ b/webrtc/examples/peerconnection/client/defaults.cc
@@ -50,10 +50,12 @@ std::string GetDefaultServerName() {
std::string GetPeerName() {
char computer_name[256];
- if (gethostname(computer_name, arraysize(computer_name)) != 0)
- strcpy(computer_name, "host");
std::string ret(GetEnvVarOrDefault("USERNAME", "user"));
ret += '@';
- ret += computer_name;
+ if (gethostname(computer_name, arraysize(computer_name)) == 0) {
+ ret += computer_name;
+ } else {
+ ret += "host";
+ }
return ret;
}
« no previous file with comments | « webrtc/examples/peerconnection/client/defaults.h ('k') | webrtc/examples/peerconnection/client/flagdefs.h » ('j') | no next file with comments »

Powered by Google App Engine