ca76526b11
if it exists.
34 lines
968 B
Plaintext
34 lines
968 B
Plaintext
--- libatalk/adouble/ad_read.c.orig Sat Feb 17 08:03:13 1996
|
|
+++ libatalk/adouble/ad_read.c Wed Nov 10 15:14:10 1999
|
|
@@ -26,13 +26,16 @@
|
|
#include <atalk/adouble.h>
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
+#include <stdio.h>
|
|
+#include <string.h>
|
|
|
|
+int
|
|
ad_read( ad, eid, off, buf, buflen )
|
|
struct adouble *ad;
|
|
int eid, off, buflen;
|
|
char *buf;
|
|
{
|
|
- int cc;
|
|
+ ssize_t cc;
|
|
|
|
/*
|
|
* We're either reading the data fork (and thus the data file)
|
|
@@ -73,10 +76,10 @@
|
|
if ( ad->ad_hf.adf_off < sizeof( ad->ad_data )) {
|
|
if ( ad->ad_hf.adf_flags & O_RDWR ) {
|
|
#define min(a,b) ((a)<(b)?(a):(b))
|
|
- bcopy( ad->ad_data + ad->ad_hf.adf_off, buf,
|
|
+ memcpy( buf, ad->ad_data + ad->ad_hf.adf_off,
|
|
min( sizeof( ad->ad_data ) - ad->ad_hf.adf_off, cc ));
|
|
} else {
|
|
- bcopy( buf, ad->ad_data + ad->ad_hf.adf_off,
|
|
+ memcpy( ad->ad_data + ad->ad_hf.adf_off, buf,
|
|
min( sizeof( ad->ad_data ) - ad->ad_hf.adf_off, cc ));
|
|
}
|
|
}
|