Compare commits

..

No commits in common. "mistress" and "v1.2" have entirely different histories.

22
kissy.c
View file

@ -25,7 +25,6 @@
#include <string.h> #include <string.h>
#include <pwd.h> #include <pwd.h>
#include <stdbool.h> #include <stdbool.h>
#include <ctype.h>
// mreowww meow nya :3 // mreowww meow nya :3
@ -65,21 +64,12 @@ int main (int argc, char **argv) {
char* user = pw2->pw_name; char* user = pw2->pw_name;
// if we have a second argument, set a custom kiss message // if we have a second argument, set a custom kiss message
char kiss[32] = "*mwah*"; char* kiss;
if (argc >= 3) { if (argc >= 3)
int len = strlen(argv[2]); kiss = argv[2];
int written_chars = 0; else
for (int i = 0; i < len; i++) { kiss = "*mwah*";
if (written_chars >= 31) {
kiss[31] = '\0';
break;
};
if (iscntrl(argv[2][i])) continue;
kiss[i] = argv[2][i];
written_chars++;
}
}
bool kissed = false; bool kissed = false;
// iterate over all files in directory // iterate over all files in directory
DIR *dir = opendir("/dev/pts"); DIR *dir = opendir("/dev/pts");