openbsd-ports/archivers/ha/patches/patch-nix_machine_c
2002-12-23 07:29:30 +00:00

22 lines
838 B
Plaintext

$OpenBSD: patch-nix_machine_c,v 1.1 2002/12/23 07:29:30 pvalchev Exp $
--- nix/machine.c.orig Wed Jan 11 23:53:00 1995
+++ nix/machine.c Mon Dec 23 00:26:56 2002
@@ -336,7 +336,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 +417,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;