Switch to strtol(). Also, NEVER declare after statements
This commit is contained in:
parent
7fa7571f61
commit
e209c4645f
2 changed files with 5 additions and 4 deletions
|
@ -27,9 +27,10 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/* $Amigan: phoned/phoned/cid.c,v 1.3 2005/06/13 01:13:30 dcp1990 Exp $ */
|
/* $Amigan: phoned/phoned/cid.c,v 1.4 2005/06/18 20:40:15 dcp1990 Exp $ */
|
||||||
/* system includes */
|
/* system includes */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <limits.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -159,8 +160,8 @@ cid_t* parse_cid(char* cidstring)
|
||||||
c->number = strdup(phone);
|
c->number = strdup(phone);
|
||||||
sscanf(cidtime, "%d:%d", (int*)&c->hour, (int*)&c->minute);
|
sscanf(cidtime, "%d:%d", (int*)&c->hour, (int*)&c->minute);
|
||||||
date[2] = 0x0;
|
date[2] = 0x0;
|
||||||
c->month = atoi(date);
|
c->month = strtol(date, NULL, 10);
|
||||||
c->day = atoi(date + 3);
|
c->day = strtol(date + 3, NULL, 10);
|
||||||
date[2] = '/';
|
date[2] = '/';
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,8 @@ void *network(b)
|
||||||
pthread_t thr;
|
pthread_t thr;
|
||||||
char cbuf[1];
|
char cbuf[1];
|
||||||
void* is;
|
void* is;
|
||||||
cbuf[0] = '\0'; cbuf[1] = '\0';
|
|
||||||
struct sockaddr_un it;
|
struct sockaddr_un it;
|
||||||
|
cbuf[0] = '\0'; cbuf[1] = '\0';
|
||||||
is = b;
|
is = b;
|
||||||
if((s = socket(AF_LOCAL, SOCK_STREAM, 0)) == -1) {
|
if((s = socket(AF_LOCAL, SOCK_STREAM, 0)) == -1) {
|
||||||
perror("socket");
|
perror("socket");
|
||||||
|
|
Loading…
Reference in a new issue