Guest User

Untitled

a guest
Apr 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. diff --git a/do_postgres/ext/do_postgres.c b/do_postgres/ext/do_postgres.c
  2. index 7381357..9c88923 100644
  3. --- a/do_postgres/ext/do_postgres.c
  4. +++ b/do_postgres/ext/do_postgres.c
  5. @@ -192,13 +192,13 @@ VALUE cConnection_initialize(VALUE self, VALUE uri) {
  6. }
  7.  
  8. VALUE r_user = rb_funcall(uri, rb_intern("user"), 0);
  9. - char * user = "postgres";
  10. + char * user = NULL;
  11. if (Qnil != r_user) {
  12. user = StringValuePtr(r_user);
  13. }
  14.  
  15. VALUE r_password = rb_funcall(uri, rb_intern("password"), 0);
  16. - char * password = "";
  17. + char * password = NULL;
  18. if (Qnil != r_password) {
  19. password = StringValuePtr(r_password);
  20. }
  21. @@ -467,4 +467,4 @@ void Init_do_postgres() {
  22. rb_define_method(cReader, "values", cReader_values, 0);
  23. rb_define_method(cReader, "fields", cReader_fields, 0);
  24.  
  25. -}
  26. \ No newline at end of file
  27. +}
Add Comment
Please, Sign In to add comment