mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
9ddd71fc60
problems as with winsock (sockets != fd), and the broken select(). based on older patch by Andrew Bachmann. patch by (François Revol <revol at free dot fr>) Originally committed as revision 1144 to svn://svn.ffmpeg.org/ffmpeg/trunk
26 lines
549 B
C
26 lines
549 B
C
|
|
#include <stdlib.h>
|
|
#include <strings.h>
|
|
#include "barpainet.h"
|
|
|
|
int inet_aton (const char * str, struct in_addr * add) {
|
|
const char * pch = str;
|
|
unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
|
|
|
|
add1 = atoi(pch);
|
|
pch = strpbrk(pch,".");
|
|
if (pch == 0 || ++pch == 0) goto done;
|
|
add2 = atoi(pch);
|
|
pch = strpbrk(pch,".");
|
|
if (pch == 0 || ++pch == 0) goto done;
|
|
add3 = atoi(pch);
|
|
pch = strpbrk(pch,".");
|
|
if (pch == 0 || ++pch == 0) goto done;
|
|
add4 = atoi(pch);
|
|
|
|
done:
|
|
add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
|
|
|
|
return 1;
|
|
}
|