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

Unified Diff: fusl/src/string/strndup.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: fusl/src/string/strndup.c
diff --git a/fusl/src/string/strndup.c b/fusl/src/string/strndup.c
index 617d27ba9e65ba384fa97433e90b1632015ee998..31c3467ae6a68db5097896a823d188302d74e9d9 100644
--- a/fusl/src/string/strndup.c
+++ b/fusl/src/string/strndup.c
@@ -1,12 +1,12 @@
#include <stdlib.h>
#include <string.h>
-char *strndup(const char *s, size_t n)
-{
- size_t l = strnlen(s, n);
- char *d = malloc(l+1);
- if (!d) return NULL;
- memcpy(d, s, l);
- d[l] = 0;
- return d;
+char* strndup(const char* s, size_t n) {
+ size_t l = strnlen(s, n);
+ char* d = malloc(l + 1);
+ if (!d)
+ return NULL;
+ memcpy(d, s, l);
+ d[l] = 0;
+ return d;
}

Powered by Google App Engine
This is Rietveld 408576698