Showing the changes to src/core/util_serial.cpp (1 of 1 file). Show all
Unified · Split
| @@ -126,15 +126,15 @@ using namespace std; · 125 unmodified lines | ||
| 126 | 126 | vector<string> SerialIOManager::availableSerialDevices() |
| 127 | 127 | { |
| 128 | 128 | vector<string> devices; |
| 129 | − const int buf_size = 4096; | |
| 129 | + const int buf_size = 4096+256; | |
| 130 | 130 | // was PATH_MAX; |
| 131 | 131 | // which apparently isn't |
| 132 | 132 | // https://stackoverflow.com/questions/9449241/where-is-path-max-defined-in-linux |
| 133 | 133 | // https://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html |
| 134 | 134 | // https://news.ycombinator.com/item?id=14194681 |
| 135 | 135 | const char * serial_dir = "/dev/serial/by-id"; |
| 136 | − char link_buf[buf_size+256]; // 1.5.0.1 (ge) added 256 for extra snprintf padding | |
| 137 | − char path_buf[buf_size]; | |
| 136 | + char link_buf[buf_size]; // 1.5.0.1 (ge) added 256 for extra snprintf padding | |
| 137 | + char path_buf[buf_size-256]; | |
| 138 | 138 | |
| 139 | 139 | DIR * dir = opendir(serial_dir); |
| 140 | 140 | |