Skip to content

Instantly share code, notes, and snippets.

View lcn2's full-sized avatar

Landon Curt Noll lcn2

View GitHub Profile
@ilyakurdyukov
ilyakurdyukov / safesys.h
Last active January 19, 2022 04:32
Helper function for escaping special characters from user-provided strings to be used in calls to system().
#ifndef SAFESYS_H
#define SAFESYS_H
#include <stdlib.h>
#include <stdarg.h>
#ifndef SAFESYS_NOMEM
#include <errno.h>
#define SAFESYS_NOMEM ENOMEM
#endif