Date: Tue, 19 Jun 2007 21:52:33 GMT From: Andrew Turner <andrew@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 121993 for review Message-ID: <200706192152.l5JLqXPu034939@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=121993 Change 121993 by andrew@andrew_hermies on 2007/06/19 21:52:10 Use INT32_{MIN,MAX} and UINT32_MAX rather than magic numbers Replace snprintf with a const char * Affected files ... .. //depot/projects/soc2007/andrew-update/lib/facund_object.c#2 edit .. //depot/projects/soc2007/andrew-update/lib/facund_server.c#6 edit Differences ... ==== //depot/projects/soc2007/andrew-update/lib/facund_object.c#2 (text+ko) ==== @@ -324,7 +324,7 @@ int32_t data; const char *errstr; - data = strtonum(value, (-0x7fffffff - 1), 0x7fffffff, &errstr); + data = strtonum(value, INT32_MIN, INT32_MAX, &errstr); if (errstr != NULL) { /* TODO: Error handeling */ return -1; @@ -335,7 +335,7 @@ uint32_t data; const char *errstr; - data = strtonum(value, 0, 0xffffffffU, &errstr); + data = strtonum(value, 0, UINT32_MAX, &errstr); if (errstr != NULL) { /* TODO: Error handeling */ return -1; ==== //depot/projects/soc2007/andrew-update/lib/facund_server.c#6 (text+ko) ==== @@ -202,7 +202,6 @@ facund_server_end_tag(void *data, const XML_Char *name) { struct facund_conn *conn; - char str[1024]; printf("< %s\n", name); conn = data; @@ -223,8 +222,8 @@ conn->call_arg = conn->call_arg->obj_parent; } } else if (strcmp(name, "facund-client") == 0) { - snprintf(str, 1024, "</facund-server>"); - facund_send(conn, str, strlen(str)); + const char *msg = "</facund-server>"; + facund_send(conn, msg, strlen(msg)); conn->close = 1; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706192152.l5JLqXPu034939>