serval-dna/nacl/nacl-20110221/curvecp/portparse.c
Daniel O'Connor bf9710fd5a Unpacked nacl-20110221 after processing by nacl-prepare-sources.
This only affects build_android, if nacl-gcc-prep is run then build/`uname -s` will be created.
2012-02-27 12:40:14 +10:30

15 lines
280 B
C

#include "portparse.h"
int portparse(unsigned char *y,const char *x)
{
long long d = 0;
long long j;
for (j = 0;j < 5 && x[j] >= '0' && x[j] <= '9';++j)
d = d * 10 + (x[j] - '0');
if (j == 0) return 0;
if (x[j]) return 0;
y[0] = d >> 8;
y[1] = d;
return 1;
}