I'm so tired but I left my apartment so I can't nap 😭
Rate my function to read an entire file
int readwholebuffer(char **str, unsigned long int initsize, int fd) {
// Try to read bytes from fd into str
// Bytes read == 0, return 0
// Bytes read < 0, free string, return -1;
// When string hits capacity, double the capacity, and reallocate the string
char *lstr = NULL, *tmp = NULL;
ssize_t bytesread = -1;
int csize = initsize, ccap = initsize;
lstr = xcalloc(initsize, sizeof(char));
while((bytesread = read(fd, lstr + (csize - ccap), ccap)) > 0) {
ccap -= bytesread;
if(ccap <= 0) {
csize *= 2;
ccap = csize / 2;
tmp = realloc(lstr, csize * sizeof(char));
if(!tmp) {
error(0, errno, "Could not reallocate enough space for lstr");
free(lstr);
lstr = NULL; // Need to set this because of the break
bytesread = -100;
break;
}
lstr = tmp;
}
}
if(bytesread < 0 && bytesread != -100) {
error(0, errno, "Ran into a read() error");
free(lstr);
lstr = NULL;
}
if(lstr) {
tmp = realloc(lstr, csize - ccap + 1);
if(!tmp) {
error(0, errno, "Could not shrink lstr after reading buffer");
free(lstr);
bytesread = -100;
}
lstr = tmp;
}
if(lstr) {
lstr[csize - ccap - 1] = '\0'; // Don't include the newline
}
*str = lstr;
return ((bytesread == 0) ? (csize - ccap) : -1);
}Weird interaction on discord today. Some woman was having issues with getting her passport, so I sent her some links. To do this, she had to add me as a friend. She was apprehensive about it, but I reassured her that I wouldn't care if she immediately unfriended me
Then like 30 minutes later she adds me again, says thank you, then starts to chat about random stuff. Mind you, she didn't want to add me or talk just a half hour ago. Eventually, she asks "code switch?", under the reasoning of " I feel like I'm at a disadvantage because you know my first and last name"
I basically replied with "if it makes you feel better, IDC about you. If you left right now I'd just go on with my day". She didn't want to do so unless we were in a VC (?????). I just cut it off because I don't have time for shenanigans like that
The whole thing was just weird. Thanks for coming to my ted talk
Then like 30 minutes later she adds me again, says thank you, then starts to chat about random stuff. Mind you, she didn't want to add me or talk just a half hour ago. Eventually, she asks "code switch?", under the reasoning of " I feel like I'm at a disadvantage because you know my first and last name"
I basically replied with "if it makes you feel better, IDC about you. If you left right now I'd just go on with my day". She didn't want to do so unless we were in a VC (?????). I just cut it off because I don't have time for shenanigans like that
The whole thing was just weird. Thanks for coming to my ted talk
👀1
Forwarded from Budy Archive (Nero)
Here's to 4 more years of people completely missing the point of the Founding Fathers.
Luckily, their arcane knowledge was passed down through the generations and the Budy Archive was established to carry on with their legacy.
Luckily, their arcane knowledge was passed down through the generations and the Budy Archive was established to carry on with their legacy.
Forwarded from 🤡Congregation of Clussy🤡 (🇩🇴 A 2007 Toyota Land Cruiser Prado)
This media is not supported in your browser
VIEW IN TELEGRAM
Wake up, Qtard. Your time is now
Forwarded from 🤡Congregation of Clussy🤡 (🇩🇴 A 2007 Toyota Land Cruiser Prado)
Forwarded from 🤡Congregation of Clussy🤡 (🇩🇴 A 2007 Toyota Land Cruiser Prado)
Sorry for forwarding, I'll make sure to download them and repost next time
If you want the uncucked version of TG, you should probably do it through fdroid
https://f-droid.org/packages/org.telegram.messenger/
https://f-droid.org/packages/org.telegram.messenger/
🫡1
Forwarded from vx-underground
Ross Ulbricht, the creator of the infamous Silk Road, has been pardoned by Donald Trump.
vx-underground
Ross Ulbricht, the creator of the infamous Silk Road, has been pardoned by Donald Trump.
RAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHH WE ARE SO FUCKING BACK
🎉1