Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught ReferenceError: n is not defined in getStringFromDB function #17

Closed
Koboom opened this issue Oct 11, 2024 · 2 comments
Closed
Assignees

Comments

@Koboom
Copy link

Koboom commented Oct 11, 2024

Hello,

I encountered an issue in the code where the variable n is not defined, leading to the error "Uncaught ReferenceError: n is not defined". The error occurs in the following code block:

function getStringFromDB(buffer, start, length) {
  var outstr = "";
  for (n = start; n < start + length; n++) {
    outstr += String.fromCharCode(buffer.getUint8(n));
  }
  return outstr;
}

The solution is to define the n variable using let in the for loop to avoid the error:

function getStringFromDB(buffer, start, length) {
  var outstr = "";
  for (let n = start; n < start + length; n++) {
    outstr += String.fromCharCode(buffer.getUint8(n));
  }
  return outstr;
}

This fix will resolve the error. Please let me know if I can assist further. Thank you!
Yüksel

@msmeissn
Copy link
Contributor

msmeissn commented Oct 11, 2024

i am not seeing this function in our code.
it also seems to be javascript, our code is in C.

can you point to the exact (file) location you see it?

@msmeissn msmeissn self-assigned this Oct 11, 2024
@ndim
Copy link
Contributor

ndim commented Oct 11, 2024

This appears to be a duplicate of exif-js/exif-js#214 and exif-js/exif-js#220, but filed against the wrong org and repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants