-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixname.cpp
More file actions
38 lines (35 loc) · 752 Bytes
/
fixname.cpp
File metadata and controls
38 lines (35 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* ##############################
* # fixname.cpp #
* # #
* # 2007-2008 Psyjo© #
* ##############################
* # Distributed under the terms of the GNU General Public License v2
*/
#include <cstdio>
#include <string>
#include <stdlib.h>
#include "stringfixer.h"
#define BUFSIZE 1024
int main(int argc, char **arg)
{
unsigned set, space;
argc--;
if (argc > 0)
{
set=atoi(arg[1]);
if(argc>1)
space=atoi(arg[2]);
else space=0;
}
else
{
set=3;
space=1;
}
Stringfixer fix (set, space);
char buf[BUFSIZE];
while (fgets(buf, BUFSIZE, stdin))
//printf("%s", fix.badStr2HtmlStr(buf).c_str());
printf("%s", fix.badStr2Str(buf).c_str()); // to ASCII
}