linux/esptun.c
static void write_esc(int fd, const char *buf, int n)
{
    for (int i = 0; i < n; ++i) {
        if (buf[i] == '\\' || buf[i] == ',' || buf[i] == '"') {
            write_all(fd, S("\\"));
        }
        write_all(fd, (const uint8_t*)&buf[i], 1);
    }
}
/**
 * Ensures we write exactly n bytes, escaping special characters. Exit in case
 * of error or EOF.
 */
Ensures we write exactly n bytes, escaping special characters. Exit in case
of error or EOF.
Ensures we write exactly n bytes escaping special characters . Exit in case of error or EOF .
static void write_esc(int fd, const char *buf, int n)
{
    for (int i = 0; i < n; ++i) {
        if (buf[i] == '\\' || buf[i] == ',' || buf[i] == '"') {
            write_all(fd, S("\\"));
        }
        write_all(fd, (const uint8_t*)&buf[i], 1);
    }
}
static void write_esc ( int fd , const char * buf , int n ) { for ( int i = 0 ; i < n ; ++ i ) { if ( buf [ i ] == ' \\ ' || buf [ i ] == ' ' || buf [ i ] == ' ' ) { write_all ( fd , S ( " \\ " ) ) ; } write_all ( fd , ( const uint8_t * ) & buf [ i ] , 1 ) ; } }
Ensures we write exactly n bytes, escaping special characters.
Ensures we write exactly n bytes escaping special characters .