mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-07 12:54:34 +00:00
Merge pull request #799 from TomHarte/WindowsBuildErrors
Fixes a couple of Windows build errors.
This commit is contained in:
commit
743353a0ed
@ -23,6 +23,7 @@
|
|||||||
#else
|
#else
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
@ -278,12 +278,12 @@ struct Executor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto copy_string = [] (uint8_t *destination, const char *source, size_t length) -> void {
|
auto copy_string = [] (uint8_t *destination, const char *source, size_t length) -> void {
|
||||||
// Copy as much of the string as will fit, and pad with spaces.
|
// Determine length of source and copy in as much as possible.
|
||||||
uint8_t *end = reinterpret_cast<uint8_t *>(stpncpy(reinterpret_cast<char *>(destination), source, length));
|
const auto source_length = std::min(strlen(source), length);
|
||||||
while(end < destination + length) {
|
memcpy(destination, source, source_length);
|
||||||
*end = ' ';
|
|
||||||
++end;
|
// Fill the rest with spaces.
|
||||||
}
|
memset(&destination[source_length], ' ', length - source_length);
|
||||||
};
|
};
|
||||||
copy_string(&response[8], inq.vendor_identifier, 8);
|
copy_string(&response[8], inq.vendor_identifier, 8);
|
||||||
copy_string(&response[16], inq.product_identifier, 16);
|
copy_string(&response[16], inq.product_identifier, 16);
|
||||||
|
Loading…
Reference in New Issue
Block a user