Skip to content

Commit

Permalink
Merge pull request LinuxCNC#2807 from havardAasen/impossible-nulls
Browse files Browse the repository at this point in the history
Fixes some compiler warnings
  • Loading branch information
andypugh authored Dec 28, 2023
2 parents 8186299 + c715355 commit 9a66726
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/hal/classicladder/emc_mods.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ char * ConvVarNameToHalSigName( char * VarNameParam )
hal_pin_t *pin = halpr_find_pin_by_name(pin_name);
if(pin && pin->signal) {
hal_sig_t *sig = SHMPTR(pin->signal);
if(sig->name) {
if(0 != sig->name[0]) {
static char sig_name[100];
// char *arrow = "\xe2\x86\x90";
char *arrow = "\xe2\x87\x92";
Expand Down
8 changes: 2 additions & 6 deletions src/libnml/nml/nml_mod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ NML_MODULE::zero_common_vars ()
min_run_time = 1e6;
max_run_time = 0;
start_cycle_time = 0;
proc_name = 0;
temp_file = 0;
temp_line = 0;
Dclock_expiration = 0;
Expand Down Expand Up @@ -271,12 +272,7 @@ NML_MODULE::setCmdChannel (RCS_CMD_CHANNEL * cmd_channel)
}
if (NULL != commandIn->cms)
{
if (NULL != commandIn->cms->ProcessName)
{
proc_name =
(char *) malloc (strlen (commandIn->cms->ProcessName) + 1);
strcpy (proc_name, commandIn->cms->ProcessName);
}
proc_name = strndup(commandIn->cms->ProcessName, LINELEN);
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/libnml/rcs/rcs_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,6 @@ int rcs_fputs(const char *_str)
break;
case RCS_PRINT_TO_FILE:
if (NULL == rcs_print_file_stream) {
if (NULL == rcs_print_file_name) {
return EOF;
}
rcs_print_file_stream = fopen(rcs_print_file_name, "a+");
}
if (NULL == rcs_print_file_stream) {
Expand Down

0 comments on commit 9a66726

Please sign in to comment.