-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: segfault action: commit revision: path_from: revision_from: 367f2f4bdcf7b294fc77105986f8dd4f78dafcea: path_to: revision_to:
commit 367f2f4bdcf7b294fc77105986f8dd4f78dafcea Author: epoch <epoch@thebackupbox.net> Date: Thu Mar 16 03:13:06 2023 +0000 some old Makefile changes I never commit'd. fixed long-standing bug with too long lines being appended getting truncated. diff --git a/.gitignore b/.gitignore
--- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +access.h +libhack.o +libhack.so +spacify segfault libirc/libirc.o libirc/libirc.so diff --git a/Makefile b/Makefile
--- a/Makefile +++ b/Makefile @@ -8,8 +8,9 @@ libhack.so: libhack.o again: clean all -segfault: LDFLAGS=-L/usr/local/lib -L$(PREFIX)/lib -lirc -lhashtable -lgcc_s -lidc -ldl -segfault: segfault.c access.h +segfault: LDFLAGS=-L/usr/local/lib -L$(PREFIX)/lib +segfault: LDLIBS=-lhashtable -lirc -lidc -ldl -lgcc_s +segfault: segfault.c | access.h clean: rm -f segfault diff --git a/segfault.c b/segfault.c
--- a/segfault.c +++ b/segfault.c @@ -1198,6 +1198,8 @@ void c_tailunlock(int fd,char *from,char *file,...) { char append_file(int fd,char *from,char *file,char *line,unsigned short nl) { int fdd; char tmp[512]; + int sz=strlen(line)+2;// +2 because nl and null after line + char *line2=malloc(sz);//let's pretend malloc()s don't fail. // char derp[2]; // FILE *fp; // derp[0]=(char)nl; @@ -1213,8 +1215,8 @@ char append_file(int fd,char *from,char *file,char *line,unsigned short nl) { snprintf(tmp,sizeof(tmp)-1,"append_file opened file '%s' with fd: %d / %d / %d\n",file,fdd,currentmaxtails,maxtails); privmsg(fd,"#cmd",tmp); } - snprintf(tmp,sizeof(tmp)-1,"%s%c",line,nl); - mywrite(fdd,tmp); + snprintf(line2,sz,"%s%c",line,nl); + mywrite(fdd,line2); // dprintf(fdd,"%s\n",line); // fcntl(fdd,F_SETFL,O_WRONLY|O_APPEND|O_CREAT); close(fdd);
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 15:53:19 2024