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

Side by Side Diff: fusl/src/network/res_querydomain.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 unified diff | Download patch
OLDNEW
1 #include <resolv.h> 1 #include <resolv.h>
2 #include <string.h> 2 #include <string.h>
3 3
4 int res_querydomain(const char *name, const char *domain, int class, int type, u nsigned char *dest, int len) 4 int res_querydomain(const char* name,
5 { 5 const char* domain,
6 » char tmp[255]; 6 int class,
7 » size_t nl = strnlen(name, 255); 7 int type,
8 » size_t dl = strnlen(domain, 255); 8 unsigned char* dest,
9 » if (nl+dl+1 > 254) return -1; 9 int len) {
10 » memcpy(tmp, name, nl); 10 char tmp[255];
11 » tmp[nl] = '.'; 11 size_t nl = strnlen(name, 255);
12 » memcpy(tmp+nl+1, domain, dl+1); 12 size_t dl = strnlen(domain, 255);
13 » return res_query(tmp, class, type, dest, len); 13 if (nl + dl + 1 > 254)
14 return -1;
15 memcpy(tmp, name, nl);
16 tmp[nl] = '.';
17 memcpy(tmp + nl + 1, domain, dl + 1);
18 return res_query(tmp, class, type, dest, len);
14 } 19 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698