SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
32
x11/xplot/patches/patch-signed_c
Normal file
32
x11/xplot/patches/patch-signed_c
Normal file
|
@ -0,0 +1,32 @@
|
|||
Index: signed.c
|
||||
--- signed.c.orig
|
||||
+++ signed.c
|
||||
@@ -32,12 +32,13 @@ to preserve same.
|
||||
*/
|
||||
#include "xplot.h"
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
char *signed_unparse(coord c)
|
||||
{
|
||||
char *r;
|
||||
char buf[50];
|
||||
- (void) sprintf(buf,"%d",c.i);
|
||||
+ (void) sprintf(buf,"%ld",c.i);
|
||||
r = malloc((unsigned) strlen(buf)+1);
|
||||
if (r == 0)
|
||||
fatalerror("malloc returned 0");
|
||||
@@ -48,9 +49,11 @@ char *signed_unparse(coord c)
|
||||
coord signed_parse(char *s)
|
||||
{
|
||||
coord r;
|
||||
- extern int atoi();
|
||||
+ const char *errstr;
|
||||
|
||||
- r.i = atoi(s);
|
||||
+ r.i = strtonum(s, LONG_MIN, LONG_MAX, &errstr);
|
||||
+ if (errstr != NULL)
|
||||
+ fprintf(stderr, "warning: signed_parse value is %s: %s\n", errstr, s);
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue