LF in getProgramInfoLog
- Dominant language
- C++
- Stars
- 330
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
A (very) minor issue, but there is a linefeed in the `getProgramInfoLog` after it has been linked
Edit: Also when created it [should yield a 0 length string](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getProgramInfoLog), but instead there is a 1 length string,
with a null char. So maybe double null characters have been added?
```JavaScript
const nodeGles = require("node-gles");
const gl = nodeGles.binding.createWebGLRenderingContext();
var program = gl.createProgram();
let log = gl.getProgramInfoLog(program);
console.log(log.length, log.charCodeAt(0));
const vs = `// Vertex Shader
void main() {
gl_Position = vec4(1.);
}`
const fs = `// Fragment shader
void main() {
gl_FragColor = vec4(1.);
}`
function loadShader(gl, type, source) {
const shader = gl.createShader(type);
gl.shaderSource(shader, source);
gl.compileShader(shader);
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
gl.deleteShader(shader);
return null;
}
return shader;
}
gl.attachShader(program, loadShader(gl, gl.VERTEX_SHADER, vs));
gl.attachShader(program, loadShader(gl, gl.FRAGMENT_SHADER, fs));
gl.linkProgram(program);
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
console.error('Unable to initialize the shader program: ' + gl.getProgramInfoLog(program));
}
log = gl.getProgramInfoLog(program);
console.log(log.length, log.charCodeAt(0))
```
yields
```
1 0
2 10
```
Which makes checks for `if (log === "")` fail
Contributor guide
Assessment
This issue has not been assessed yet.