diff options
Diffstat (limited to 'clang/test/Analysis/ptr-arith.c')
-rw-r--r-- | clang/test/Analysis/ptr-arith.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/Analysis/ptr-arith.c b/clang/test/Analysis/ptr-arith.c index 7b66b2f8fe3..ca23437f92a 100644 --- a/clang/test/Analysis/ptr-arith.c +++ b/clang/test/Analysis/ptr-arith.c @@ -12,3 +12,18 @@ void f2() { char *p = foo(); ++p; } + +char* memchr(); +static int +domain_port (const char *domain_b, const char *domain_e, + const char **domain_e_ptr) +{ + int port = 0; + + const char *p; + const char *colon = memchr (domain_b, ':', domain_e - domain_b); + + for (p = colon + 1; p < domain_e ; p++) + port = 10 * port + (*p - '0'); + return port; +} |