* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
/* this file contains various functionality useful to standalone systems */
int retval = load_file(CMD_ARGV[0], &data, &len);
if (retval == ERROR_OK) {
- command_print(CMD_CTX, "%s", data);
+ command_print(CMD, "%s", data);
free(data);
} else
- command_print(CMD_CTX, "%s not found", CMD_ARGV[0]);
+ command_print(CMD, "%s not found", CMD_ARGV[0]);
return ERROR_OK;
}
info = mallinfo();
if (prev > 0)
- command_print(CMD_CTX, "Diff: %d", prev - info.fordblks);
+ command_print(CMD, "Diff: %d", prev - info.fordblks);
prev = info.fordblks;
- command_print(CMD_CTX, "Available ram: %d", info.fordblks);
+ command_print(CMD, "Available ram: %d", info.fordblks);
return ERROR_OK;
}
if (retval != ERROR_OK)
break;
- command_print(CMD_CTX, "%zu", len - pos);
+ command_print(CMD, "%zu", len - pos);
pos += chunk;
}
if (retval == ERROR_OK)
- command_print(CMD_CTX, "Copied %s to %s", CMD_ARGV[0], CMD_ARGV[1]);
+ command_print(CMD, "Copied %s to %s", CMD_ARGV[0], CMD_ARGV[1]);
else
- command_print(CMD_CTX, "copy failed");
+ command_print(CMD, "copy failed");
if (data != NULL)
free(data);
{
if (strcmp("eth0", ifr->ifr_name) != 0)
continue;
- strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));
+ strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name) - 1);
if (ioctl(SockFD, SIOCGIFHWADDR, &ifreq) < 0) {
close(SockFD);
return JIM_ERR;
.handler = handle_meminfo_command,
.mode = COMMAND_ANY,
.help = "display free heap space",
+ .usage = "",
},
#endif
{