Bug in strptime?
Posted: Sun Jan 12, 2025 11:59 pm
Info:
ESP32-C6
ESP-IDF v5.5 (master branch of https://github.com/espressif/esp-idf)
I'm trying to read a string in format "(YYMMDDhhmmssX)"
X is still NULL (0x0) but it should point to the character W which it doesn't.
Am I miss interpreting how strptime should work?
Tried just compiling a program with gcc.
ESP32-C6
ESP-IDF v5.5 (master branch of https://github.com/espressif/esp-idf)
I'm trying to read a string in format "(YYMMDDhhmmssX)"
Code: Select all
#include <time.h>
char* X = NULL;
struct tm tm;
const char* str_data = "(250111163740W)";
X = strptime(str_data , "(%y%m%d%H%M%S", &tm);
ESP_LOGI(TEST_TAG, "X is: %p\r\n", X);
Code: Select all
TEST: X is: 0x0Am I miss interpreting how strptime should work?
Tried just compiling a program with gcc.
Code: Select all
#define _GNU_SOURCE
#include <stdio.h>
#include <time.h>
int main()
{
struct tm tm;
char *X = NULL;
const char* str_data = "(250111163740W)";
X = strptime(str_data, "(%y%m%d%H%M%S", &tm);
printf("X is: %c, X value: %p\r\n", *X, X);
return 0;
}
Code: Select all
X is: W, X value: 0x555ddc8d3011