Browse Source

more bug fixes

master
Felix von Leitner 20 years ago
parent
commit
3dc718a1a5
  1. 3
      socket/socket_sendfile.c
  2. 1
      uint/uint16_pack.c
  3. 1
      uint/uint16_pack_big.c
  4. 1
      uint/uint32_pack.c
  5. 1
      uint/uint32_pack_big.c

3
socket/socket_sendfile.c

@ -35,13 +35,12 @@ int socket_sendfile(int out,int in,uint32 offset,uint32 bytes) {
int socket_sendfile(int out,int in,uint32 offset,uint32 bytes) {
char buf[BUFSIZE];
uint32 n,m;
int n,m;
uint32 sent=0;
if (lseek(in,offset,SEEK_SET) != offset)
return -1;
while (bytes>0) {
char* tmp=buf;
uint32 tobedone;
if ((n=read(in,tmp,(bytes<BUFSIZE)?bytes:BUFSIZE))<=0)
return (sent?sent:-1);
while (n>0) {

1
uint/uint16_pack.c

@ -1,6 +1,5 @@
#define NO_UINT16_MACROS
#include "uint16.h"
#include <endian.h>
void uint16_pack(char *out,uint16 in) {
out[0]=in&255;

1
uint/uint16_pack_big.c

@ -1,6 +1,5 @@
#define NO_UINT16_MACROS
#include "uint16.h"
#include <endian.h>
void uint16_pack_big(char *out,uint16 in) {
out[0]=in>>8;

1
uint/uint32_pack.c

@ -1,6 +1,5 @@
#define NO_UINT32_MACROS
#include "uint32.h"
#include <endian.h>
void uint32_pack(char *out,uint32 in) {
*out=in&0xff; in>>=8;

1
uint/uint32_pack_big.c

@ -1,6 +1,5 @@
#define NO_UINT32_MACROS
#include "uint32.h"
#include <endian.h>
void uint32_pack_big(char *out,uint32 in) {
out[3]=in&0xff; in>>=8;

Loading…
Cancel
Save