bifcl: Other minor cleanups

This commit is contained in:
Tim Wojtulewicz 2023-02-23 13:14:34 -07:00
parent 8662b29ac6
commit 8e295df115
3 changed files with 5 additions and 8 deletions

View file

@ -255,7 +255,7 @@ void init_alternative_mode()
static char name[1024];
strncpy(name, input_filename, sizeof(name) - 1);
name[sizeof(name) - 1] = 0;
name[sizeof(name) - 1] = '\0';
char* dot = strchr(name, '.');
if ( dot )
*dot = '\0';
@ -264,7 +264,7 @@ void init_alternative_mode()
{
static char plugin_canon[1024];
strncpy(plugin_canon, plugin, sizeof(plugin_canon) - 1);
plugin_canon[sizeof(plugin_canon) - 1] = 0;
plugin_canon[sizeof(plugin_canon) - 1] = '\0';
char* colon = strstr(plugin_canon, "::");
if ( colon ) {
@ -355,10 +355,9 @@ int main(int argc, char* argv[])
for ( int i = optind; i < argc; i++ )
{
FILE* fp_input;
char* slash;
input_filename = input_filename_with_path = argv[i];
slash = strrchr(input_filename, '/');
char* slash = strrchr(input_filename, '/');
if ( (fp_input = fopen(input_filename, "r")) == NULL )
{

View file

@ -4,8 +4,6 @@
#include <string>
#include <cstring>
using namespace std;
#include <stdio.h>
#include <stdlib.h>

View file

@ -13,7 +13,7 @@ enum builtin_func_arg_type
extern const char* builtin_func_arg_type_bro_name[];
class BuiltinFuncArg
class BuiltinFuncArg final
{
public:
BuiltinFuncArg(const char* arg_name, int arg_type);
@ -29,7 +29,7 @@ public:
void PrintCArg(FILE* fp, int n);
void PrintValConstructor(FILE* fp);
protected:
private:
const char* name;
int type;
const char* type_str;