casting a pointer type does not magically change the size of the

referenced variable
This commit is contained in:
naddy 2013-04-03 15:14:16 +00:00
parent 174693ba80
commit 93b3d4f665
2 changed files with 11 additions and 9 deletions

View File

@ -1,19 +1,18 @@
# $OpenBSD: Makefile,v 1.28 2013/03/10 22:28:04 espie Exp $ # $OpenBSD: Makefile,v 1.29 2013/04/03 15:14:16 naddy Exp $
COMMENT= archive files using the HSC compression method COMMENT= archive files using the HSC compression method
DISTNAME= ha0999 DISTNAME= ha0999
PKGNAME= ha-0.999b PKGNAME= ha-0.999b
REVISION = 2
CATEGORIES= archivers CATEGORIES= archivers
MASTER_SITES= ftp://ftp.kiarchive.ru/pub/unix/arcers/ MASTER_SITES= ftp://ftp.kiarchive.ru/pub/unix/arcers/
EXTRACT_SUFX= .tgz EXTRACT_SUFX= .tgz
FAKE= all
# GPL # GPL
PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_CDROM= Yes
REVISION = 1 WANTLIB= c
WANTLIB= c
USE_GMAKE= Yes USE_GMAKE= Yes

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-nix_machine_c,v 1.2 2008/11/22 09:36:20 jasper Exp $ $OpenBSD: patch-nix_machine_c,v 1.3 2013/04/03 15:14:17 naddy Exp $
--- nix/machine.c.orig Thu Jan 12 07:53:00 1995 --- nix/machine.c.orig Thu Jan 12 07:53:00 1995
+++ nix/machine.c Sat Nov 22 00:23:49 2008 +++ nix/machine.c Wed Apr 3 17:05:00 2013
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
***********************************************************************/ ***********************************************************************/
@ -9,16 +9,19 @@ $OpenBSD: patch-nix_machine_c,v 1.2 2008/11/22 09:36:20 jasper Exp $
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
@@ -336,7 +337,7 @@ char *md_timestring(unsigned long t) { @@ -335,8 +336,10 @@ char *md_timestring(unsigned long t) {
static char ts[22]; static char ts[22];
struct tm *tim; struct tm *tim;
+ time_t tt;
- tim=localtime((long *)&t); - tim=localtime((long *)&t);
+ tim=localtime((time_t *)&t); + tt = t;
+ tim=localtime(&tt);
sprintf(ts,"%04d-%02d-%02d %02d:%02d",tim->tm_year+1900,tim->tm_mon+1, sprintf(ts,"%04d-%02d-%02d %02d:%02d",tim->tm_year+1900,tim->tm_mon+1,
tim->tm_mday,tim->tm_hour,tim->tm_min); tim->tm_mday,tim->tm_hour,tim->tm_min);
return ts; return ts;
@@ -417,7 +418,7 @@ char *md_stripname(char *mdfullpath) { @@ -417,7 +420,7 @@ char *md_stripname(char *mdfullpath) {
if (plainname!=NULL) free(plainname),plainname=NULL; if (plainname!=NULL) free(plainname),plainname=NULL;
if ((plainname=malloc(strlen(mdfullpath)+1))==NULL) if ((plainname=malloc(strlen(mdfullpath)+1))==NULL)
error(1,ERR_MEM,"md_stripname()"); error(1,ERR_MEM,"md_stripname()");