openbsd-ports/archivers/ha/patches/patch-nix_machine_c
2008-11-22 09:36:20 +00:00

30 lines
1.0 KiB
Plaintext

$OpenBSD: patch-nix_machine_c,v 1.2 2008/11/22 09:36:20 jasper Exp $
--- nix/machine.c.orig Thu Jan 12 07:53:00 1995
+++ nix/machine.c Sat Nov 22 00:23:49 2008
@@ -20,6 +20,7 @@
***********************************************************************/
#include <stdlib.h>
+#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
@@ -336,7 +337,7 @@ char *md_timestring(unsigned long t) {
static char ts[22];
struct tm *tim;
- tim=localtime((long *)&t);
+ tim=localtime((time_t *)&t);
sprintf(ts,"%04d-%02d-%02d %02d:%02d",tim->tm_year+1900,tim->tm_mon+1,
tim->tm_mday,tim->tm_hour,tim->tm_min);
return ts;
@@ -417,7 +418,7 @@ char *md_stripname(char *mdfullpath) {
if (plainname!=NULL) free(plainname),plainname=NULL;
if ((plainname=malloc(strlen(mdfullpath)+1))==NULL)
error(1,ERR_MEM,"md_stripname()");
- for (i=strlen(mdfullpath)-1;i>0;i--) {
+ for (i=strlen(mdfullpath)-1;i>=0;i--) {
if (mdfullpath[i]=='/') {
i++;
break;